下面程序的运行结果是( )。 include<stdio.h> main() {char a[80],*p="AbabCDcd"; int i=0,j=0; while(*(p++)!='\0') {if(*p>='a'&&*p<='z'){a[i]=*p;i++;} } a[i]='\0'; puts(A); }
第1题:
下面程序的输出结果是_______。 #include<stdio.h> main() { char*p[]={"DOOL","OPK","H","SP"}; int i; for (i=3;i>=0;i-,i-) printf("%c",*p[i]); printf("\n"); }
A.SO
B.SP
C.SPOPK
D.SHOB
第2题:
下列程序的输出结果是( )。
#inClude<stdio.h>
main()
{ charch[2][5]={"1234","5678"},*p[2];
int i,j,s=0;
for(i=0;i<2;i++)
p[i]=ch[i];
for(i=0;i<2;i++)
for(j=0;p[i][j]>'\0';j+=2)
{ s=p[i][j]-'0';
printf("%d",s);}
}
A.6357
B.6135
C.1357
D.691357
第3题:
以下程序运行后的输出结果是() 。 #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); }
第4题:
下面程序的运行结果是 #include<stdio.h> main() { char a[]="morning",t; int i,j=0; for(i=1;i<7;i++) if(a[j]<a[i])j=i; t=a[j]; a[j]=a[7]; a[7]=a[j]; puts[a];}
A.mrgninr
B.mo
C.moring
D.morning
第5题:
下面程序的运行结果是( )。 #include<stdio.h> void delch(char *s) { int i,j; char*a; a=s; for(i=0,j=0;a[i]!='\0' ;i++) if(a[i]>='0' &&a[i]<='9') { s[j]=a[i]; j++;} s[j]='\0'; } main() { char*item="a34bc"; delch(item); printf("\n%s" ,item);}
A.abc
B.34
C.a34
D.a34bc