下面程序执行后的输出结果是( )。#include int main() {int i = 0, s = 0;for (;; ) {if ( i == 3 || i == 5 )continue;if ( i == 6 )break;i++;s += i;};printf( "%d", s );return 0;}
查看答案
下面程序执行后的输出结果是( )。#include int main(){ int a = 0, i; for ( i = 1; i < 5; i++ ) switch ( i ) { case 0: case 3: a += 2; case 1: case 2: a += 3; default: a += 5; } printf( "%d", a ); return(0);}
A. 10
B. 13
C. 31
D. 死循环
若有定义:float w; int a,b;则合法的switch语句是( )。
A. switch (w) { case 1.0:printf("*\n"); case 2.0:printf("**\n");}
B. switch (a); { case 1:printf("*\n"); case 2:printf("**\n");}
C. switch (b) { case 1:printf("*\n"); default:printf("\n"); case 1+2:printf("**\n");}
D. switch (a+b); { case 1:printf("*\n"); case 2:printf("**\n"); default:printf("\n");}
执行下面语句后,s=____。int i=1,s=0;while(i++)if(!(i%3))break;elses+=i;printf("%d",s);
int main( ){int n1,n2;scanf("%d",&n2);while(n2!=0){n1=n2%10;n2=n2/10;printf("%d",n1);}return 0;}程序运行后,如果从键盘上输入1298,则输出结果为____。