单选题程序: class TestApp{ public static void main (String[] args){ int X=5: switch (x){ case l: case 2: case 3: System. out.println(“一季度”); break; case 4: case 5: case 6: System. out.println(“二季度”); break; default: System. out.println(“三季度以上”); break; } } } 上述程序运行后的结果是哪项?()A 一季度B二季度C三季度以上D无输出
单选题
程序: class TestApp{ public static void main (String[] args){ int X=5: switch (x){ case l: case 2: case 3: System. out.println(“一季度”); break; case 4: case 5: case 6: System. out.println(“二季度”); break; default: System. out.println(“三季度以上”); break; } } } 上述程序运行后的结果是哪项?()
A
一季度
B
二季度
C
三季度以上
D
无输出
参考解析
解析:
暂无解析
相关考题:
以下程序的运行结果是 【 9 】 。main( ){ int a=2,b=7,c=5;switch(a0){ case 1:switch(b0){ case 1: printf ("@"); break;case 2: printf("!"); break;}case 0: switch(c==5){ case 0 : printf (" * "); break;case 1 : printf(" # "); break;case 2: printf(" $ "); break;}default : printf("");}printf("\n");}
下列语句序列执行后,k的值是( )。 public class c6{ public static void main(String[ ] args) { int a=10, b=18, c=30; switch (b% A) { case 7: c--; break; case 8: c-=2; break; case 9: c-=3; break; default: c* =b; break; } System.out.println (c); } }A.28B.29C.27D.30
设有如下程序: import java.util.*; public class Sun { public static void main(String args[ ]) { int score; String a; Random r=new Random(); score=r.nextInt(4)+5; switch(score) { case 0: a="E"; break; case 1: a="D"; break; case 2: a="C"; break; case 3: a="B"; break; default: a="A"; } System.out.println(A) ; } } 程序运行的结果是( )。A.a="A"B.aa"E" a="A"C.a="E"D.a="C"
阅读下列代码 public class Test 2005{ public static void main(String args[]){ Strings="Test"; switch(s){ case "Java":System.out.print("Java"); break; case "Language":System.out.print("Language"); break; case "Test":System.out.ptint("Test"); break; } } } 其运行结果是A.JavaB.LanguageC.TestD.编译出错
( 19 )阅读下列代码public class Test2005{public static void main(String args[]){String s= ″ Test ″ ;Switch(s){case ″ Java ″ : System.out.print( ″ Java ″ ) ;break ;case ″ Language ″ : System.out.print( ″ Language ″ ) ;break ;case ″ Test ″ : System.out.print( ″ Test ″ ) ;break ;}}}其运行结果是A ) JavaB ) LanguageC ) TestD )编译出错
以下代码的输出结果是什么? class Foo{ public static void main(String args[]){ int x=4,j=0; switch(x){ case 1:j++; case 2:j++; case 3:j++; case 4:j++; case 5:j++; break; default:j++; } System.out.println(j); } }()A.1B.2C.3D.编译错误
以下程序的运行结果是( )。main()(int a=2,b=7,c=5;switch(a>0){case 1:switch(b<0){case 1:switch(");break;case 2:printf("!");break;}case 0:switch(c==5){case 0:printf("*");break;case 1:printf("");break;case 2:printf("$");break;}default:printf ("&");}printf("\n");}
程序:classTestApp{publicstaticvoidmain(String[]args){intX=5:switch(x){casel:case2:case3:System.out.println(一季度”);break;case4:case5:case6:System.out.println(二季度”);break;default:System.out.println(三季度以上”);break;}}}上述程序运行后的结果是哪项?()A.一季度B.二季度C.三季度以上D.无输出
给出下面代码片段: public class Test{ public static void main (String args[ ]){ int m; switch(m) { case 0:System.out.println("case 0"); case 1:System.out.println("case 1"):break; case 2: default:System.out.println("default"); } } } 下列m的( )值将引起"default"的输出。A.1B.2C.4D.0
下列语句序列执行后,k的值是______。 public class Testll { public static void main(String[] args) { int a=10, b=18, c=30; switch(b%a){ case 7: c--;break; case 8: c-=2;break; case 9: c-=3;break; default: c * =b;break; } System.out.println(c); } }A.28B.27C.29D.540
下列程序执行的结果是______。 public class ex6 { public static void main(String[] args) { char ch='8'; int r=10; switch(ch+l) { case '7': r=r+3; case '8': r=r+5; case '9': r=r+6; break; default: ; } System.out.print(r); } }A.14B.13C.16D.10
下列程序运行后的输出结果是 ______。 include void main(){ int s=0,k for(k=7;k>=0 下列程序运行后的输出结果是 ______。include<iostream.h>void main(){int s=0,kfor(k=7;k>=0;k--){switch(k){case 1:case 4:case 7:s+ +;break:case 2:case 3:case 6:break;case 0:case 5:s+=2;break;}
阅读下列代码 public class Test { public static void main(String args[]) { String s = "Test"; switch (s) { case "Java": System.out.print("Java"); break; case "Language": System.out.print("Language"); break; case "Test": System.out.print("Test"); break; } } } 其运行结果是( )。A.JavaB.LanguageC.TestD.编译出错
下列程序的运行结果是( )。 #includestdio.h void main {int s=0,k; for(k=7;k1;k--) {switch(k) {case 1: case 4: case 7: s++: break; case 2: case 3: case 6:break; case 0: case 5: s+=2: break; }} printf("s=%d",s); }A. s=3B.s=4C.s=5D.无输出结果
下列程序的输出的结果是______。 public class exl6 { public static void main(String[] args) { int j=10; for(int i=0;i<3;i++) { j-=i+1; switch (j){ case 3: break; case 5: break; case 8: break; default: j=0;break; } } System,out.println(j); } }A.5B.3C.8D.0
下列程序执行之后,将输出 public class exl9 { public static void main(string[] args) { int x=3; int y=7; switch(y/x){ case 1: y*=2; break; case 2: y*=3; break; case 3: y*=4; break; default: y=0; } System.out.print(y); } }A.28B.21C.14D.0
给出下面代码段: public class Test{ public static void main(String args[] ) { int m; switch(m) { case 0: System.out.println("case 0"); case 1: System.out.println("case 1"); break; case 2: break; default: System.out.println("default"); } } } 下列m的值能引起输出“default”的是( )。A.0B.1C.2D.4
以下程序的运行结果为?class test {public static void main(String args[]) {int i,j=0;for(i=10;iswitch(j) {case (0) : j=j+1;case ( 1、 : j=j+2; break;case ( 2、: j=j+3; break;case (10) : j=j+10; break;default : break;}System.out.println(j);}}A. 0B. 1C. 2D. 3E. 10
public class SwitchTest { public static void main(String[] args) { System.out.println(“value = “ + switchIt(4)); } public static int switchIt(int x) { int j = 1; switch (x) { case 1: j++; case 2: j++; case 3: j++; case 4: j++; case 5: j++; default: j++; } return j + x; } } What is the result?() A、 value = 3B、 value = 4C、 value = 5D、 value = 6E、 value = 7F、 value = 8
程序: classTestApp{ public static void main (String[] args){ int X=5: switch (x){ case l: case 2: case 3: System. out.println(“一季度”); break; case 4: case 5: case 6: System. out.println(“二季度”); break;default:System. out.println(“三季度以上”); break; ) } ) 上述程序运行后的结果是哪项?()A、一季度B、二季度C、三季度以上D、无输出
程序: class TestApp{ public static void main (String[] args){ int X=5: switch (x){ case l: case 2: case 3: System. out.println(“一季度”); break; case 4: case 5: case 6: System. out.println(“二季度”); break; default: System. out.println(“三季度以上”); break; } } } 上述程序运行后的结果是哪项?() A、 一季度B、二季度C、三季度以上D、无输出
class TestApp{ public static void main(String[] args){ int x = 5; switch(x){ case 1: case 2: case 3: System.out.println(“一季度”); break; case 4: case 5: case 6: System.out.println(“二季度”); case 7: case 8: case 9: System.out.println(“三季度”); break; ase 10: case 11: ase 12: System.out.println(“四季度”); break; default: System.out.println(“不是有效的月份”); } } } 上述程序运行后的结果是哪项?() A、一季度B、二季度C、三季度D、四季度
public class SwitchTest { public static void main (String args) { System.out.PrintIn(“value =” +switchIt(4)); } public static int switchIt(int x) { int j = 1; switch (x) { case 1: j++; case 2: j++; case 3: j++; case 4: j++; case 5: j++; default:j++; } return j + x; } } What is the output from line 3? ()A、 Value = 3B、 Value = 4C、 Value = 5D、 Value = 6E、 Value = 7F、 Value = 8
单选题public class SwitchTest { public static void main (String args) { System.out.PrintIn(“value =” +switchIt(4)); } public static int switchIt(int x) { int j = 1; switch (x) { case 1: j++; case 2: j++; case 3: j++; case 4: j++; case 5: j++; default:j++; } return j + x; } } What is the output from line 3? ()A Value = 3B Value = 4C Value = 5D Value = 6E Value = 7F Value = 8
单选题public class SwitchTest { public static void main(String[] args) { System.out.println(“value = “ + switchIt(4)); } public static int switchIt(int x) { int j = 1; switch (x) { case 1: j++; case 2: j++; case 3: j++; case 4: j++; case 5: j++; default: j++; } return j + x; } } What is the result?()A value = 3B value = 4C value = 5D value = 6E value = 7F value = 8
单选题class TestApp{ public static void main(String[] args){ int x = 5; switch(x){ case 1: case 2: case 3: System.out.println(“一季度”); break; case 4: case 5: case 6: System.out.println(“二季度”); case 7: case 8: case 9: System.out.println(“三季度”); break; ase 10: case 11: ase 12: System.out.println(“四季度”); break; default: System.out.println(“不是有效的月份”); } } } 上述程序运行后的结果是哪项?()A一季度B二季度C三季度D四季度
单选题程序: classTestApp{ public static void main (String[] args){ int X=5: switch (x){ case l: case 2: case 3: System. out.println(“一季度”); break; case 4: case 5: case 6: System. out.println(“二季度”); break;default:System. out.println(“三季度以上”); break; ) } ) 上述程序运行后的结果是哪项?()A一季度B二季度C三季度以上D无输出