【单选题】【消耗次数:1】
以下程序段的运行结果是()。 int s=15; switch(s/4) {default: printf(Over ) ; case 1: printf(One ) ; break; case 2: printf(Two ) ; }
Two
Over Two
Over One
One
参考答案:
复制
纠错
相关题目
【单选题】 以下程序段的运行结果是()。ints=15;switch(s/4){default:printf("Over");case1:printf("One");break;case2:printf("Two");}
①  Two
②  OverTwo
③  OverOne
④  One
【单选题】 以下程序的运行结果是()。voidmain(){intn=9;switch(n--){default:printf("%d",n++);case8:case7:printf("%d",n);break;case6:printf("%d",n++);case5:printf("%d",n);}}
①  8
②  7
③  89
④  87
【单选题】 下列程序执行后的输出结果是() void func1(a) { switch(a) { case 1:printf(good); case 2:printf(nice); default:printf(end); } } main( ) { int i=2; func1(i); printf(\n); }
①  nice
②  end
③  good
④  niceend
【单选题】 有以下程序,程序运行以后的输出结果是() #include stdio.h main( ) { int a[ ]={2,3,5,4},i; for(i=0;i switch(i%2) { case 0:switch(a[i]%2) {case 0:a[i]++;break; case 1:a[i]--; }break; case 1:a[i]=0; } for(i=0;i printf(\n); }
①  3 3 4 4
②  2 0 5 0
③  3 0 4 0
④  0 3 0 4
【单选题】 有以下程序: main( ) { int c; while((c=getchar( ) ) != \n ) { switch(c- 2 ) { case 0 : case 1 : putchar(c+4) ; case 2 : putchar(c+4) ; break; case 3 : putchar(c+3) ; default: putchar(c+2) ; break; } } printf(\n } 当输入: 247, 程序的输出结果是()。
①  689
②  6689
③  66778
④  66887
【单选题】 下述程序的运行结果( )。 #includevoid main() { int x=1,a=0,b=0; switch(x) { case 0:b++; case 1:a++; case 2:a++;b++; } printf(a=%d,b=%d\n,a,b); } case 1:a++; case 2:a++;b++; } printf(a=%d,b=%d\n,a,b); }
①  a=1,b=1
②  a=2 ,b=1
③  a=2,b=2
④  a=3,b=3
【单选题】 有以下程序:main(){intc;while((c=getchar())!=\n){switch(c-2){case0:case1:putchar(c+4);case2:putchar(c+4);break;case3:putchar(c+3);default:putchar(c+2);break;}}printf("\n");}当输入:247回车,程序的输出结果是()。
①  689
②  6689
③  66778
④  66887
【单选题】 下述程序的运行结果( )。 #includevoid main() { int x=1,a=0,b=0; switch(x) { case 0:b++; case 1:a++; case 2:a++;b++; } printf(a=%d,b=%d\n,a,b); }
①  a=2,b=1
②  a=1,b=2
③  a=0,b=1
④  a=1,b=0
【单选题】 运行以下程序,从键盘上输入china# #includevoid main() { int v1=0,v2=0; char ch; while((ch=getchar())!=#) switch(ch) { case a: case h: default: v1++; case 0:v2++; } printf(%d,%d\n,v1,v2); } 运行结果( )。
①  2,2
②  3,3
③  4,4
④  5,5
【单选题】 #define X a+b main( ) { int a=3,b=4,s1; s1=2*X; printf(%d\n,s1); },以上程序的运行结果是( )?
①  8
②  14
③  10
④  6
随机题目
【判断题】 由树转化为二叉树,其根结点的右子树总是空的。
①  正确
②  错误
【判断题】 串的堆分配存储是一种动态存储结构。
①  正确
②  错误
【单选题】 设有一个字符串S=abcdefgh,问该串的最大子串个数为( )。
①  8
②  36
③  37
④  9
【单选题】 设有一个字符串S=Welcome to Shenyang!,问该串的长度为( )。
①  18
②  19
③  20
④  21
【判断题】 “DT”是“DATA”的子串。
①  正确
②  错误
【判断题】 在顺序存储结构中,串的插入算法是非常方便的。
①  正确
②  错误
【判断题】 广义表组成的元素可以是不同形式的元素。
①  正确
②  错误
【判断题】 如果一个串中所有的字母均在另一个串中出现,则说明前者是后者的子串。
①  正确
②  错误
【单选题】 具有35个结点的完全二叉树的深度为( )。
①  5
②  6
③  7
④  8
【单选题】 假设在一棵二叉树中,双分支结点数为15,单分支结点数为30个,则叶子结点数为( )个。
①  15
②  16
③  17
④  47