单项选择题
若有以下程序
#include<stdio.h>
main()
int s=0,n;
for(n=0;n<4;n++)
switch(n)
default:s+=4;
case 1:s+=1;break;
case 2:s+=2;break;
case 3:s+=3;
printf("%d\n",s);
则程序的输出结果是______。
A.11
B.10
C.13
D.15
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序 #include<stdio.h> main() int s; scanf( %d ,&s); while(s>0) switch(s) case 1:pfinttf( %d ,s+5); case 2:prinft( %d ,s+4);break; case 3:prinft( %d ,s+3); default: printf( %d ,s+1);break; scanf( %d ,&s); 运行时,若输入1 2 3 4 5 0<回车>,则输出结果是______。
A.6566456
B.66656
C.66666
D.6666656
点击查看答案&解析
单项选择题
有以下程序 #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=2,b=1
B.a=2,b=2
C.a=1,b=1
D.a=1,b=0
点击查看答案&解析
相关试题
以下不构成无限循环的语句或语句组是___...
有以下程序 #include<stdio.h> main...
关于“while(条件表达式)循环体”,以下...
在以下给出的表达式中,与while(E)中的(...
有以下程序 #include<stdio.h> main...