niusouti.com
更多“下列程序段的执行结果为m=1n=1Select Case mCase 1Select Case nCase 0Print" * * 0 * *"Case 1P ”相关问题
  • 第1题:

    下列程序段的执行结果为 m=1 n=1 Select Case m Case 1 Select Case n Case 0 Print" * * 0 * *" Case 1 Print" * *.* *" End Select Case 2 Print"* *,2 * *," End Select

    A.* * 0 * *

    B.* * 1 * *

    C.* * 2 * *

    D.0


    正确答案:B
    解析:SelectCase结构的一般格式为:SelectCaseexpr[Caseexpr1][clause1][Caseexpr2][clause2][Caseelse][clausen)EndSelect其中expr是测试表达式,如果满足exprn,就执行这条语句,然后退出,因为m=1、n=1,所以执行语句Print"**1**"。

  • 第2题:

    阅读下列程序段,写出运行结果 int a=2,b=7,c=5; switch (a>0) { case 1:switch (b<0) { 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("&"); }


    C

  • 第3题:

    【填空题】下列程序段运行的结果为() x=2; switch(x%3) { case 2: printf("Are "); case 1:printf("you "); case 0:printf("right"); default: printf("?"); }


    tl0a={(1,2,3}{4,5,6},{7,8,9}};

  • 第4题:

    写出下列程序段的输出结果:_______。 int i=1; switch (i%3 ) { case 0: printf("zero"); case 1: printf("one"); case 2: printf("two"); }


    6

  • 第5题:

    1、写出下列程序段的输出结果:_______。 int i=1; switch (i%3 ) { case 0: printf("zero"); case 1: printf("one"); case 2: printf("two"); }


    A