有以下程序: main() { char k; int i; for(i=1;i<3;i++) { scanf("%c",&k); switch(k) { case '0': printf("another\n"); case '1': printf("number\n"); } } } 程序运行时,从键盘输入01<回车>,程序执行后的输出结果是( )。
A.another number
B.another number another
C.another number number
D.number number
第1题:
以下程序的输出结果是( )。
main
{ char*s="12134211";
int v[4]=(0,0,0,0),k,i;
for(k=0;s[k];k++)
{ switch(s[k])
{ case'1':i=0;
case'2':i=1;
case'3':i=2;
case'4':i=3;}
}
v[i]++:
}
for(k=0;k<4;k++)printf("%d",v[k]);
A.4 2 1 1
B.0 0 0 8
C.4 6 7 8
D.8 8 8 8
第2题:
有以下程序: #include <stdio.h> main() { char k; int i; for(i=1;i<3;i++) { scanf("%c",&k); switch(k) { case '0': printf("another\n"); case '1': printf("number\n"); } { } 程序运行时,从键盘输入:01<回车>,程序执行后的输出结果是( )。
A.another number
B.another number another
C.another number
D.number number
第3题:
以下程序的输出结果是 () 。 main() { char *s="12134211" ; int v[4]={0 ,0,0,0} ,k,i ; for(k=0 ;s[k] ;k++) { switch(s[k]) { case '1' :i=0 ; case '2' : i=1 ; case '3' : i=2 ; case '4' : i=3 ; } v[i]++ ; } for(k=0 ;k<4;k++) printf("%d ",v[k]) ; }
A.4 2 1 1
B.0 0 0 8
C.4 6 7 8
D.8 8 8 8
第4题:
有以下程序: main () { char k; int i; for(i=1;i<3;i++) { scanf("%c",&k); switch(k) { case '0': printf("another\n"); case '1': printf("number\n"); } } } 程序运行时,从键盘输入:01<回车>,程序执行后的输出结果是
A.another number
B.another number another
C.another number number
D.number number
第5题:
有以下程序 main() { char k;int i; for(i=1;i<3;i++) { scanf("%c",&k); switch(k) { case'0':printf("another\n"); case'1':printf("number\n"); } } } 程序运行时,从键盘输入:01<回车>,程序执行后的输出结果是
A.another number anothor
B.another number number
C.another number
D.number number