
有以下程序: #include<string.h> #include<iostream.h> void main() { char * p="abcde\0fghjik\0"; cout < < strlen(p) ;} 程序运行后的输出结果是
A.12
B.15
C.6
D.5

A.12
B.15
C.6
D.5
第1题
A.100
B.200
C.程序错误
D.300
第2题
有以下程序: #include<stdio.h> #define X 5+6 main() {int a=2,c; C=X*2: printf("%d",C); } 程序运行后的输出结果是()。
A.17
B.22
C.16
D.11
第3题
A.7,4,2
B.8,7,5,2
C.9,7,6,4
D.8,5,4,2
第4题
有以下程序: #include<stdio.h> #include<string.h> #include void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++;t--; if(*s)f(s,t): } main() {char str[10]="abcdefg",*P; P=str+strlen(str)/2+1: f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是()。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
第5题
A.741
B.963
C.852
D.875421
第6题
有以下程序 #include <stdio.h> main() { FILE *fp1; fp1=fopen("f1.txt","w"); fprintf(fp1,"abc"); fclose(fp1); } 若文本文件f1.txt中原有内容为:good,则运行以上程序后,文件n.txt中的内容为______。
A.goodabc
B.abcd
C.abc
D.abcgood
第7题
(21 )有以下程序
# include (stdio.h >
main ()
{ int a = l ; b = 2 ;
for (; a < 8 ; a++ ) { b+=a ; a+=2 ; }
printf (" %d , %d \ n ", a , b ) ;
}
程序运行后的输出结果是
A ) 9 , 18
B ) 8 , 11
C ) 7 , 11
D ) 10 , 14
第8题
有以下程序 #include <stdio.h> #include <string.h> typedef strtlct{ char name[9]; char sex;floatscore[2]; }STU; void f(STU A)
{ STU b={"Zhao",'m',85.0,90.0}; int i; strcpy(a.name,b.name); a.sex=b.sex; for(i=0;i<2;i++) a.score[i]=b
A.Qian,f,95,92
B.Qian,m,85,90
C.Zhao,f,95,92
D.Zhao,m,85,90
第9题
有以下程序 #include<stdio.h> void main() { int a=1,b=0; printf("%d,",b=(a++)+(a++)); pfintf("%d\n",a+B); } 程序运行后的输出结果是()。
A.4,6
B.2,5
C.3,5
D.2,6