【单选题】【消耗次数:1】
有以下程序#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
【单选题】 有如下程序: #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
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=1,b=2,c=3; if(c=a)printf(%d\n else printf(%d\n }
①  1
②  3
③  5
④  6
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=5,b=4,c=3,d=2; if(ac)printf(%d\n else if((c-1=d)==1)printf(%d\n,d+1); else printf(%d\n,d+2); }
①  0
②  1
③  2
④  3
【单选题】 以下程序输出结果是( )。 Main() {int x=2,y=-1,z=2; if(xy) if(y0) z=0; else z+=1; printf(%d\n }
①  3
②  2
③  1
④  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
【单选题】 下述程序的运行结果( )。 #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=5,b=4,c=3,d=2; if(ac)printf(%d\n else if((c-1=d)==1)printf(%d\n,d+1); else printf(%d\n,d+2); }
①  1
②  2
③  3
④  4
【单选题】 有如下程序: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
随机题目
【单选题】 Henryshouldhaveknown_______thantoaskTomformoney.
①  more
②  better
③  much
④  less
【单选题】 Heisacollegeteacherofmanyyears’_______.
①  experiment
②  experiments
③  experiences
④  experience
【单选题】 Threehourspassed,andwewerestillunableto____Johnofhisson’sguilt
①  convince
②  inform
③  warn
④  convict
【单选题】 Ithasbeen_______thatMaryandTom’sweddingwillbeheldnextSunday
①  announcing
②  claiming
③  claimed
④  announced
【单选题】 Whoshouldberesponsible___thestaff’sabsenteeism?
①  to
②  at
③  for
④  in
【单选题】 ProfessorSmithpromisedtolook______mypaper,thatis,toreaditcarefullybeforethedefense.
①  after
②  over
③  on
④  into
【单选题】 ---Excuseme,howmuchisthejacket?---It’s499Yuan.________.
①  Oh,no.That’sOK!
②  Howdoyoulikeit?
③  Whichdoyouprefer?
④  Wouldyouliketotryiton?
【单选题】 ---I’msorry.Ilostthekey.---______________.
①  Well,it’sOK
②  No,it’sallright
③  Youarewelcome
④  Youarewrong
【单选题】 Whenwillthework__________?
①  becompeted
②  compete
③  complete
④  becompleted
【单选题】 I’msorrytohearthatyourfatherissufferingfromaserious____
①  sickness
②  illness
③  badness
④  disease