现有如下程序段#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.acfijkbefijklqswzB.abceffiijjkklqswzC.befijklqswz acfijkD.abcefijklqswz
现有如下程序段
#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
相关考题:
现有如下程序段,则程序段的输出结果为 【16】 。#include "stdio.h"int fun(){static int k;return k;}main(){int m;m=fun();printf("%d\n",m);}
有如下程序段#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;in;i++) if(strcmp(a[i],q)0)q=a[i]; return q;}main(){ char s[N][M]={"tomeetme","you","and","he","china"}; char *p; int n=5; p=find(s,n); puts(p);}则执行后输出的结果为A.he B.and C.you D.tomeetme
以下程序的输出结果是【 】。includeincludechar*fun(char*0{ char *p--t;retur 以下程序的输出结果是【 】。include <stdio.h>include <string.h>char *fun(char *0{ char *p--t;return (p+strlen(t)/2);}main(){ char *str="abcdefgh";str=ftm(str);puts(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 iA.acfijkbefijklqswzB.abceffiijjkklqswzC.befijklqswz acfijkD.abcefijklqswz
现有如下程序段 #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.acfijkbefijklqswzB.abceffiijjkklqswzC.befijklqswz acfijkD.abcefijklqswz
以下程序的输出结果是【 】。includeincludechar*fun(char*t){ char *p=t;retur 以下程序的输出结果是【 】。include <stdio.h>include <string.h>char *fun(char *t){ char *p=t;return (p+strlen(t)/2);}main(){ char *str="abcdefgh";str=ftm(str);puts(str);}
以下程序运行后的输出结果是() 。 #include <stdio.h> #include <stdlib.h> #include <string.h> main() { char *p; int i; p=(char *)malloc(sizeof(char)*20); strcpy(p,"welcome"); for(i=6;i>=0;i--) putchar(*(p+i)); printf("n"); free(p); }
分析下面程序的运行结果()。 #include "stdio.h" #include "string.h" main() { printf("%dn",strlen("IBMn012")); }
21、以下程序执行后的结果为 。 #include "stdio.h" #include <string.h> void fun(char *s) { char a[10]; strcpy(a,"string"); s=a; } main() { char *p="gao"; fun(p); printf("%s\n",p); }A.gaoB.结果不确定C.strD.string