若a为整型变量,b为字符型变量,则以下正确的switch语句是 A: switch((int)x/10){ case 1:a++;break;case 2:b++;break;case 3:c++;break;} B: switch(b){ case ‘\042’;x=a/b;break;case ‘6’;x=a*b;break;case ‘\010’;x=a+c;break;} C: switch((int)x/10);{ case 0:a++;break;default:b++;break;case 3+1:c++;break;case 3:d++;break;} D: switch(a/100+10){ case2 :x=a/b;break; case6 :x=a*b;break;case8 :x=a+c;break;case10 :x=a-c;break; }
若a为整型变量,b为字符型变量,则以下正确的switch语句是 A: switch((int)x/10){ case 1:a++;break;case 2:b++;break;case 3:c++;break;} B: switch(b){ case ‘\042’;x=a/b;break;case ‘6’;x=a*b;break;case ‘\010’;x=a+c;break;} C: switch((int)x/10);{ case 0:a++;break;default:b++;break;case 3+1:c++;break;case 3:d++;break;} D: switch(a/100+10){ case2 :x=a/b;break; case6 :x=a*b;break;case8 :x=a+c;break;case10 :x=a-c;break; }
对于下面的程序段,输出的结果是:int x=10,y=5;switch(x){case 12:y=y+5;case 10:y++;case 8: y=y-2;case 6: y=y*2;default: y=0;}System.out.println(y); A: 5 B: 0 C: 6 D: 8
对于下面的程序段,输出的结果是:int x=10,y=5;switch(x){case 12:y=y+5;case 10:y++;case 8: y=y-2;case 6: y=y*2;default: y=0;}System.out.println(y); A: 5 B: 0 C: 6 D: 8
下列语句序列执行后, k 的值是( ) int i=10, j=18, k=30; switch( j - i ) { case 8 : k++; case 9 : k+=2; case 10: k+=3; default : k/=j; }
下列语句序列执行后, k 的值是( ) int i=10, j=18, k=30; switch( j - i ) { case 8 : k++; case 9 : k+=2; case 10: k+=3; default : k/=j; }
假设变量x、k都已定义,下列语句片段中,无语法错误的是( )。 A: switch(x){ case x>=90: putchar('A'); case x<60: putchar('E'); } B: switch(x) { case 1+2: k='A'; defualt: k='E'; case 2*4: k='B'; } C: switch(x){ case 2+x: k=x-2; case 3*x: k=x+3; default: k=0; } D: switch(x){ case 3.5: k=0.5*x; case 7.8: k=8*x; default: k=0; }
假设变量x、k都已定义,下列语句片段中,无语法错误的是( )。 A: switch(x){ case x>=90: putchar('A'); case x<60: putchar('E'); } B: switch(x) { case 1+2: k='A'; defualt: k='E'; case 2*4: k='B'; } C: switch(x){ case 2+x: k=x-2; case 3*x: k=x+3; default: k=0; } D: switch(x){ case 3.5: k=0.5*x; case 7.8: k=8*x; default: k=0; }
We regret to inform you that Case Nos.5 and 8 were broken and their contents were damaged _____________ improper packing.
We regret to inform you that Case Nos.5 and 8 were broken and their contents were damaged _____________ improper packing.
若输入x值为7,下列程序运行后,x值是______。 #include void main() { int x; scanf("%d",&x); switch(x) { case 6: x+=1; case 7: case 8: x+=2; case 9: x+=3;break; default: x+=4; } printf("%d ",x); }
若输入x值为7,下列程序运行后,x值是______。 #include void main() { int x; scanf("%d",&x); switch(x) { case 6: x+=1; case 7: case 8: x+=2; case 9: x+=3;break; default: x+=4; } printf("%d ",x); }
(4分) public class Hello9 { public static void main(String args[]) {int 分数=75; String grade; switch(分数/10) { case 10 : case 9: grade="优"; break; case 8: grade="良"; break; case 7: grade="中"; break; case 6: grade="及"; break; default: grade="差"; } System.out.println("成绩等级:"+grade); }}程序的输出结果为:
(4分) public class Hello9 { public static void main(String args[]) {int 分数=75; String grade; switch(分数/10) { case 10 : case 9: grade="优"; break; case 8: grade="良"; break; case 7: grade="中"; break; case 6: grade="及"; break; default: grade="差"; } System.out.println("成绩等级:"+grade); }}程序的输出结果为:
执行程序段 int k=5,n=0; while(k--) switch(k) { case 1: case 3:n+=1;break; default:n+=2; case 2: case 4: n+=3;break; }后,n和k的值分别为: A: 10 -1 B: 13 -1 C: 8 0 D: 10 0
执行程序段 int k=5,n=0; while(k--) switch(k) { case 1: case 3:n+=1;break; default:n+=2; case 2: case 4: n+=3;break; }后,n和k的值分别为: A: 10 -1 B: 13 -1 C: 8 0 D: 10 0
若有int x=85;,执行下列程序段后,变量x的正确结果是:(______) switch (x/10) { case 10: case 9: printf("A");break; case 8: printf("B");break; default: printf("C"); } A: ABC B: B C: C D: BC
若有int x=85;,执行下列程序段后,变量x的正确结果是:(______) switch (x/10) { case 10: case 9: printf("A");break; case 8: printf("B");break; default: printf("C"); } A: ABC B: B C: C D: BC
The case of noun are mainly ____________. A: accusative case B: dative case C: possessive case D: nominative case
The case of noun are mainly ____________. A: accusative case B: dative case C: possessive case D: nominative case