更多"以下程序的输出结果是 #include <stdio.h> #in"的相关试题:
[单项选择]以下程序输出的结果是 #include<stdio.h> #include<string.h> main( ) {charw[][10]={"ABCD","EFGH","IJKL","MNOP"}1,k; for(k=1;k<3;k++) printf("%s/n",&w[k][k]);}
A. ABCD FGH KL
B. ABC EFG U M
C. EFG JK 0
D. FGH KL
[单项选择]以下程序的输出结果是 #include<stdio.h> #include<string.h> main( ) { char b1[8]=“abcdefg”,b2[8],*pb=b1+3; while(--pb>=b1)strcpy(b2,pb) ; printf(“%d/n”,strlen(b2)); }
A. 8
B. 3
C. 1
D. 7
[单项选择]以下程序运行后的输出结果是 #include<stdio.h> #include<string.h> main( ){ char x[]="STRING"; x[0]=0; x[1]='/0'; x[2]='0'; printf("%d%d/n", sizeof(x),strlen(x)); }
A. 6 1
B. 7 0
C. 6 3
D. 7 1
[单项选择]以下程序的输出结果是 ( )
#include<string.h>
main( )
char s1[]="123",s2[]="abc",ss[20]="010";
strcat(ss+1,strcpy(s2,s1));
printf("%s/n",ss);
A. 010123
B. 0abc
C. 01123
D. 01abc
[单项选择]以下程序的输出结果是 ( ) #include<string.h> main( ) {char s1[]="123",s2[]="abc",ss[20]="010"; strcat(ss+1,strcpy(s2,s1)); printf("%s/n",ss); }
A. 010123
B. 0abc
C. 01123
D. 01abc
[单项选择]以下程序的输出结果是______。 #include <string.h> main( ) { char*a="abcdefghi";int k fun(a);puts(a); } fun(char*s) { int x,y; char c for(x=0,y=strlen(s)-1;x<y:x++,y--) {c=s[y];s[y]=s[x];s[x]=c;} }
A. ihgfedcba
B. abcdefghi
C. abcdedeba
D. ihgfefghi
[单项选择]设已执行预编译命令#include<string.h>,以下程序段的输出结果是( )。
char s[]=" an apple" ;
printf(" %d/n" ,strlen(s));
A. 7
B. 8
C. 9
D. 10
[单项选择]设已执行预编译命令#include<string.h>,以下程序段的输出结果是 char s[]=" an apple" ; printf("%d/n",strlen(s));
A. 7
B. 8
C. 9
D. 10
[单项选择]下面程序的输出结果是 #include<iostream.h> #include<string.h> voidmain( ) { charp1[10],p2[10]; strcpy(p1,"abc"); strcpy(p2,"ABC"); charstr[50]="xyz"; strcpy(str+2,strcat(p1,p2)); cout<<str; }
A. xyzabcABC
B. zabcABC
C. xyabcABC
D. yzabcABC