【单选题】【消耗次数:1】
有如下程序:main(){  intx=1,a=0,b=0;  switch(x){  case0:b++;case1:a++;case2:a++;b++;}  printf(“a=%d,b=%d\n”,a,b);}该程序的输出结果是()
a=2 b=1
a=1 b=1
a=1 b=0
a=2 b=2
参考答案:
复制
纠错
相关题目
【单选题】 下述程序的运行结果( )。 #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
【单选题】 下述程序的运行结果( )。 #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
【单选题】 有如下程序: #includevoid main( ) { int a=2,b=-1,c=2; if (ab) if (b0) c=0; else c++; printf(%d\n } 该程序的输出结果是
①  0
②  1
③  2
④  3
【单选题】 以下程序的输出结果是()。 main( ) { int b[3][3]={0,1,2,0,1,2,0,1,2},i,j,t=0; for(i=0;i for(j=i;j t=t+b[i][b[j][j]]; printf(%d\n,t); }
①  3
②  4
③  1
④  9
【单选题】 有以下程序#includestdio.hmain(){ int a=1,b=0;if(--a) else if(a==0) b+=2;else b+=3;printf(“%d\n”,b); }程序运行后的输出结果是(  )。
①  0
②  1
③  2
④  3
【单选题】 有以下程序#includestdio.hmain(){ int a=1,b=0;if(--a) else if(a==0) b+=2;else b+=3;printf(“%d\n”,b); }程序运行后的输出结果是。
①  0
②  1
③  2
④  3
【单选题】 以下程序段:int i,a=3,b=2;i=(--a==b++)?--a:++b;printf(i=%d a=%d b=%d,i,a,b);输出结果是。
①  i=1 a=1 b=3
②  i=3 a=2 b=3
③  i=4 a=1 b=4
④  i=4 a=2 b=4
【单选题】 有以下程序,程序运行以后的输出结果是() #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
【简答题】 #include stdio.hint main(){char a[]=I love China!,b[20],*p1,*p2;p1=a;p2=b; for(;*p1!=\0p1++,p2++)*p2=*p1; *p2=\0// printf(string a is:%s\n printf(string b is:%s\n return 0;}以上程序运行结果为string b is:[填空1]。
【单选题】 #define X a+b main( ) { int a=3,b=4,s1; s1=2*X; printf(%d\n,s1); },以上程序的运行结果是( )?
①  8
②  14
③  10
④  6
随机题目
【判断题】 游戏环境就是室内环境
①  正确
②  错误
【单选题】 下列不属于形象玩具的是( )
①  动物玩具
②  棋类玩具
③  交通玩具
④  模拟日常用品的玩具
【单选题】 下列关于游戏场地的空间密度对学前儿童游戏的影响说法不正确的是( )
①  A.空间密度会影响儿童游戏的社会性品质(人际互动的质量)
②  B.较大的空间,可减少社会性游戏及打闹混战游戏的发生频率
③  C.个人安静的游戏一般多发生在较小、封闭式的空间中
④  D.空间密度对学前儿童游戏的影响体现为游戏的社会性层次的提高或降低
【判断题】 幼儿游戏妨碍其学习
①  正确
②  错误
【判断题】 放声大笑是游戏的特征
①  正确
②  错误
【判断题】 多样性探究是幼儿提高唤醒水平的探究
①  正确
②  错误
【判断题】 幼儿阅读是游戏
①  正确
②  错误
【判断题】 角色游戏是有规则游戏
①  正确
②  错误
【判断题】 特定性探究是提高幼儿唤醒水平的探究
①  正确
②  错误
【判断题】 幼儿通过表情传递信息给同伴
①  正确
②  错误