有以下程序段,运行后的输出结果是()int x=100, a=10,b=20, ok1=5,ok2=0;if(a
查看答案
有以下程序段,运行后的输出结果是()int p=30;printf("%d\n",(p/3>0? p/10: p%3));
A. 30
B. 0
C. 10
D. 3
有以下程序段,运行后的输出结果是()char c; int k;c='b'; k=4;switch(c){case 'a':k=k+1;break;case 'b': k=k+2;case 'c':k=k+3;}printf("%d\n",k);
A. 5
B. 6
C. 7
D. 9
有以下程序段,运行后的输出结果是()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=0,b=0
B. a=1,b=1
C. a=1,b=0
D. a=2,b=1
若a、b、c1、c2、d、x、y均是整型变量,以下正确的switch语句是( )
A. switch(a+b);{case 1: y=a+b; break;case 0: y=a-b; break;}
B. switch(a*a+b*b){case 3;case 1:y=a+b; break;}
C. switch (a){case c1: y=a-b; break;case c2: x=a*d; break;default: x=a+b;}
D. switch(a-b){default: y=a*b; break;case 3: case 4: x=a+d; break;case 10: case 11: y=a-d; break;}