【单选题】【消耗次数:1】
下述程序的运行结果( )。 #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 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(){  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 a=2,b=-1,c=2; if (ab) if (b0) c=0; else c++; printf(%d\n } 该程序的输出结果是
①  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
【单选题】 有以下程序#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
【单选题】 以下程序的输出结果是()。 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
【单选题】 运行以下程序,从键盘上输入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
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=1,b=2,c=3; if(c=a)printf(%d\n else printf(%d\n }
①  1
②  3
③  5
④  6
【单选题】 有以下程序,程序运行以后的输出结果是() #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
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=4,b=3,c=5,t=0; if(aa=b;b=t; if(aa=c;c=t; printf(%d,%d,%d\n,a,b,c); }
①  5,1,3
②  4,5,6
③  5,0,3
④  3,4,7
随机题目
【判断题】 文艺复兴时期人文主义的核心思想是以人为本。
①  正确
②  错误
【判断题】 拉伯雷的《十日谈》在艺术上奠定了欧洲短篇小说的基础。
①  正确
②  错误
【判断题】 文艺复兴时期文学是欧洲中古末期的文学。
①  正确
②  错误
【多选题】 《堂吉诃德》中桑丘的性格特征有( )。
①  胆小怕事,日光短浅
②  功利实际贪小便宜
③  朴实善良,忠心耿耿
④  有同情心和正义感
【多选题】 罗马著名的戏剧家有( )。
①  普劳图斯
②  泰伦斯
③  西塞罗
④  卢克莱修
【多选题】 中世纪文学主要包括( )。
①  教会文学
②  骑士文学
③  英雄史诗
④  城市文学
【多选题】 古希腊抒情诗的主要体裁有( )。
①  民歌
②  双管歌
③  讽刺诗
④  琴歌
【多选题】 中世纪的“骑士精神”包括有( )。
①  忠君
②  禁欲
③  护教
④  行侠
【单选题】 在《埃涅阿斯纪》中,维吉尔把罗马人的祖先、特洛伊王子埃涅阿斯写成是神的后裔,其最主要目的是
①  为了忠实于史实
②  为了忠实于神话传说
③  为了渲染史诗的浪漫气氛
④  为屋大维的统治寻找依据,歌颂罗马统治者
【单选题】 欧洲文学史上第一部“文人史诗”指的是
①  《伊利亚特》
②  《奥德修纪》
③  《埃涅阿斯纪》
④  《罗兰之歌》