单项选择题
有以下程序 #include <stdio.h> main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++; break; case 1:b++; break; } case 2:a++;b++; break; case 3:a++;b++; } printf("a=%d,b=%d\n",a,b); } 程序的运行结果是
A.a=1,b=0
B.a=2,b=2
C.a=1,b=1
D.a=2,b=1
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
阅读下列程序,当运行函数时,输入asd af aa z67,则输出为 #include <stdio.h> #include <ctype.h> #inelude <string.h> int fun(char *str) { int i,j=0; for(i=0;str[i]!=’ 0’;i++) if(str[i]!=’’)str[j++]=str[i]; str[j]=’ 0’; } main() { char str[81]; int n; printf( Input a string: ); gets(str); puts(str); fun(str); printf( %s n ,str); }
A.asdafaaz67
B.asd af aa z67
C.asd
D.z67
点击查看答案&解析
单项选择题
有如下程序 main() { char ch[2][5]={ 6937 , 8254 },*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=10*s+p[i][j]-'0'; printf( %d n ,s);} 该程序的输出结果是
A.69825
B.63825
C.6385
D.693825
点击查看答案&解析
相关试题
fseek函数的正确调用形式是 【14】 。
以下程序的作用是:从名为filea.dat的文本...
函数my_cmp()的功能是比较字符串s和t的...
以下程序的输出结果是 【12】 。float...
以下说明语句中, 【13】 是结构体类型...