执行语句序列 int n: cin>>n: switch (n) { case 1: case 2:cout<<'1'; case 3: case 4: cout<<'2': break; default: cout<<'3': }时,若键盘输入1,则屏幕显示A.1B.2C.3D.12

执行语句序列 int n: cin>>n: switch (n) { case 1: case 2:cout<<'1'; case 3: case 4: cout<<'2': break; default: cout<<'3': }时,若键盘输入1,则屏幕显示

A.1

B.2

C.3

D.12


相关考题:

若有定义 : float x=1.5; int a=1,b=3,c=2; 则正确的 switch 语句是A)switch(x){ case 1.0: printf("*\n");case 2.0: printf("**\n");}B)switch((int)x);{ case 1: printf("*\n");case 2: printf("**\n");}C)switch(a+b){ case 1: printf("*\n");case 2+1: printf("**\n");}D)switch(a+b){ case 1: printf("*\n");case c: printf("**\n");}

执行语句序列 intn: cin>>n: switch(n) { casel: case2:cout<<'1': case 3: case4:cout<<'2': break: delhult:cout<<'3': } 时,若键盘输入1,则屏幕显示A.1B.2C.3D.12

若有定义float x=1.5;int a=1,b=3,c=2;,则正确的switch语句是A.swimh(x) {case 1.0:printf("*\n"); case 2.0:printf("**\n");}B.switch((int)x); {case 1:printf("*\n"); case 2:printf("**\n");}C.switch(a+D. {case 1:pfintf("*\n"); case 2+1:pfintf("**\n");}switch(a-I-{case 1:pfintf("*\n"); case c:printf("**\n");}

执行语句序列: int n; cin>>n; switch(n) { case 1: case 2:cout<<'1'; case 3: case 4:cout<<'2';break; default:cout<<'3'; }时,若从键盘输入1,则屏幕显示______ 。A.1B.2C.3D.12

若定义:float x;int a,b;,则正确的switch语句是( )。A.switch(x) { case1.0:cout<<"*\n"; case2.0:cout<<"**\n";B.switch(x) { case 1.2:cout<<"*\n"; case 3:cout<<"**\n"; }C.switch(a+b) { case 1.0:cout<<"*\n"; case 1+2:cout<<"**\n ";D.switch(a+b) { case 1:cout<<"*\n"; case 2:cout<<"**\n";

1.若有定义:“float x=1.5; int a=1,b=3,c=2;”,则正确的switch语句是 。A.switch (x) {case 1.0:printf("*n"); case 2.0:printf("**n");}B.switch ((int)x) ; {case 1:printf("*n"); case 2:printf("**n");}C.switch (a+b) {case1:printf(**n); case c:printf(**n);}D.switch (a+b) {case 1:printf("*n"); case 2+1:printf("**n");}

执行如下语句序列,不可能出现的情况是: int n; cin>>n; switch(n){ case 1: case 2: cout<<'A'; case 3: case 4: cout<<'B'; break; default:cout<<'C'; }A.显示:AB.显示:BC.显示:CD.显示:AB

若有定义: float x=1.5; int a =1,b=3,c=2;则能编译通过的switch语句是()A.switch(a+b) { case 1: printf("*n"); case 2+1 : printf("**n"); }B.switch((int)x ) { case 1: printf("*n"); case 2 : printf("**n"); }C.switch(x ) { case 1.0: printf("*n"); case 2.0 : printf("**n"); }D.switch(a+b ) { case 1: printf("*n"); case c: printf("**n"); }E.switch(a+b ) { case 1: printf("*n"); case (int)x: printf("**n"); }

当从键盘输入'c'时,以下程序段的输出结果是 。 cin>>n; switch(n) { default: cout<<"errorn";break; case 'a': case 'A':case 'b':case 'B':cout<<"goodn";break; case 'c': case 'C':cout<<"passn"; case 'd': case 'D':cout<<"warnn"; }