• 2022-06-10
    在 Select Case a结构中,描述判断条件 1 ≦ a ≦ 10 的测试项应该写成()。
    A: Case 1 <= a <= 10
    B: Case 1 ≦ a And a ≦ 10
    C: Case Is >= 10 or Is >= 1
    D: Case 1 To 10
  • D

    内容

    • 0

      若有int x=1;,执行下列程序段后,变量x的正确结果是( ) switch(x*10) { case 9:x+=1; case 10:x+=1; case 11:x+=1; default:x+=1; } A: 1 B: 2 C: 3 D: 4

    • 1

      下述程序段中,无语法错误的是: A: int a=2,b=0; switch(a){ case b+1:a--;break; case b=5: a+=10;break;} B: char x=‘A’,y; switch(x){ case ‘A’:y++;break; case -1: y=5; } C: int a,b=5; switch(b) { case b>;0: a=1;break; case b==0: a=0;break; } D: E: define M 10 int a=1,b; switch(a) {case M-9:b+=5;break; case 1: b=1;break;}

    • 2

      假设X的值是5,则执行以下语句时,可得到的输出结果是ABCDEF的Select Case语句是 ( ) A: Select Case X Case 10 To 1 Print“ABCDEF” End Select B: Select Case X Case Is>15,Is<5 Print"ABCDEF" End Select C: Selecl Case K Case Is>5,1,3,To 10 Print"ABCDEF" End Select D: Select Case X Case 1,3,Is>5 Print"ABCDEF" End Select

    • 3

      以下程序段中,执行结果与其他3个选项不同的是 A: Dim y As Integer B: y = 11 C: Select Case y D: Case 15 To 5 E: Print "Executed" F: End Select G: Dim y As Integer H: y = 10 I: Select Case y J: Case Is > 10, Is < 10 K: Print " Executed " L: End Select M: Dim y As Integer N: y = 10 O: Select Case y P: Case Is > 15, 1, 5 To 8 Q: Print " Executed " R: End Select S: Dim y As Integer T: y = 10 U: Select Case y V: Case 1, 3, Is > 6 W: Print " Executed " X: End Select

    • 4

      执行程序段 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