[单选题]

现有如下程序段

#include "stdio.h"

#include "string.h"

main()

{ char a[]="acfijk"; /*这里是有序的字符序列*/

char b[]="befijklqswz"; /*这里是有序的字符序列*/

char c[80],*p;

int i=0,j=0,k=0;

while(a[i]!=′/0′&&b[j]!= ′/0′)

{ if(a[i]<b[j])c[k++]=a[i++];

else if(a[i]>b[j])c[k++]=b[j++];

else { c[k++]=b[j++];

i++;}}

while(a[i]==′/0′&&b[j]!= ′/0′)

c[k++]=b[j++];

while(a[i]!=′/0′&&b[j]== ′/0′)

c[k++]=a[i++];

c[k]=′/0′;

puts(c);}

则输出结果是

A.acfijkbefijklqswz

B.abceffiijjkklqswz

C.befijklqswz acfijk

D.abcefijklqswz

参考答案与解析:

相关试题

现有如下程序段 #include "stdio.h" #include "str

[单选题]现有如下程序段#include "stdio.h"#include "string.h"main(){ char a[]="acfijk"; /*这里是有序的字符序列*/char b[]="befijklqswz"; /*这里是有序的字符序列*/char c[80],*p;int i=0,j=0,k=0;while(a[i]!=′/0′&&b[j]!= ′/0′){ if(a[i]<b[j])c[k++]=a[i++];else if(a[i]>b[j

  • 查看答案
  • 有如下程序段#include "stdio.h"#include "string

    [单选题]有如下程序段#include "stdio.h"#include "string.h"#define N 10#define M 10char *find(char(*a)[M],int n){ char *q;int i; q=a[0]; for(i=0;i<n;i++) if(strcmp(a[i],q)<0)q=a[i]; return q;}main(){ char s[N][M]={"tomeetme","you","and","he","chin

  • 查看答案
  • 现有如下程序段 #include "stdio.h" main() { int

    [单选题]现有如下程序段#include "stdio.h"main(){ int k[30]={12,324,45,6,768,98,21,34,453,456};int count=0,i=0;while(k[i]){ if(k[i]%2==0||k[i]%5==0)count++;i++; }printf("%d,%d/n",count,i);}则程序段的输出结果为A.7,8B.8,8C.7,10D.8,10

  • 查看答案
  • 现有如下程序段 #include "stdio.h" main() { int

    [单选题]现有如下程序段#include "stdio.h"main(){ int k[30]={12,324,45,6,768,98,21,34,453,456};int count=0,i=0;while(k[i]){ if(k[i]%2==0||k[i]%5==0)count++;i++; }printf("%d,%d/n",count,i);}则程序段的输出结果为A.7,8B.8,8C.7,10D.8,10

  • 查看答案
  • 现有如下程序段 #include "stdio.h" main( ) { int

    [单选题]现有如下程序段#include "stdio.h"main( ){ int a[5][6]={23,3,65,21,6,78,28,5,67,25,435,76,8,22,45,7,8,34,6,78,32,4,5,67,4,21,1};int i=0,j=5;printf("%d/n",*(&a[0][0]+2*i+j-2));}则程序的输出结果为A.21B.78C.23D.28

  • 查看答案
  • 现有如下程序段 #include "stdio.h" main() { int

    [单选题]现有如下程序段#include "stdio.h"main(){ int a[5][6]={23,3,65,21,6,78,28,5,67,25,435,76,8,22,45,7,8,34,6,78,32,4,5,67,4,21,1};int i=0,j=5;printf("%d/n",*(&a[0][0]+2*i+j-2));}则程序的输出结果为A.21B.78C.23D.28

  • 查看答案
  • 现有如下程序段 #include "stdio.h" main() { int

    [单选题]现有如下程序段#include "stdio.h"main(){ int a[5][6]={23,3,65,21,6,78,28,5,67,25,435,76,8,22,45,7,8,34,6,78,32,4,5,67,4,21,1};int i=0,j=5;printf("%d/n",*(&a[0][0]+2*i+j-2));}则程序的输出结果为A.21B.78C.23D.28

  • 查看答案
  • 现有如下程序段#include"stdio.h"#include"string.

    [单选题]现有如下程序段 #include"stdio.h" #include"string.h" main() { char a[]="acfijk";/*这里是有序的字符序列*/ char b[]="befijklqswz";/*这里是有序的字符序列*/ char c[80],*p; int i=0,j=0,k=0; while(a[i]!二'/0'&&b[j]!='/0') { if(a[i]<b[j])c[k++]=a[i++]; else iA.acfij

  • 查看答案
  • 现有如下程序段#include"stdio.h"#include"string.

    [单选题]现有如下程序段 #include"stdio.h" #include"string.h" main() { char a[]="acfijk"; /*这里是有序的字符序列*/ char b[]="befijklqswz"; /*这里是有序的字符序列*/ char c[80],*p; int i=0,j=0,k=0; while(a[i]!='/0'&&b[j]!='/0') { if(a[i]<b[j])c[k++]=a[i++]; else if(a[i

  • 查看答案
  • 现有如下程序段 #include"stdio.h" intfun(intk,in

    [单选题]现有如下程序段#include "stdio.h"int fun(int k,int *m){if(k%3)*m=k*k;else *m=k/3;}main(){ int (*p)(int,int *),m;p=fun;(*p)(78, &m);printf( "%d\n",m);}则程序段的输出结果为A.24B.25C.26D.27

  • 查看答案
  • 现有如下程序段 #include "stdio.h" #include "str