【单选题】【消耗次数:1】
若有函数定义:intfunc(){staticintm=0;returnm++;}以下程序段运行后屏幕输出为()。inti;for(i=1;ii++)func();printf("%d",func());
0
1
4
5
参考答案:
复制
纠错
相关题目
【单选题】 以下程序段运行后变量a的值为()。inti=1,a=0;for(;ii++){continue;a+=i;}
①  6
②  3
③  0
④  5
【单选题】 若有定义:inti,x=0;语句for(i=1;ii++)x+=2;与下列()程序段不等价。
①  i=1;for(;ii++)x+=2;
②  i=1;for(;;i++)x+=2;
③  for(i=1;i){x+=2;i++;}
④  i=1;for(;i){x+=2;i++;}
【单选题】 以下程序的运行结果是()。intfun(inta[4][4]){inti;for(i=0;ii++)printf("%2d",a[i][2]);printf("\n");}main(){inta[4][4]={1,1,2,2,1,9,0,0,2,4,0,0,0,5,9,8};fun(a);}
①  1905
②  2000
③  2008
④  2009
【单选题】 以下程序段的运行结果是()。inta[]={1,2,3,4},i,j;j=1;for(i=3;ii--){a[i]=a[i]*j;j=j*3;}for(i=0;ii++)printf("%d",a[i]);
①  36912
②  181294
③  271894
④  541894
【单选题】 执行下面程序:main(){intx=1,y=1,z=1;x=x+++y+++z++;printf("%d,%d,%d",x,++y,z++);}输出的结果为()
①  4,3,2
②  3,3,2
③  3,3,3
④  3,2,2
【单选题】 以下程序段运行后s的值是()。inta[3][3]={1,2,3,4,5,1,2,3,4};inti,j,s=1;for(i=0;ii++)for(j=i+1;jj++)s+=a[i][j];
①  6
②  120
③  7
④  240
【单选题】 以下程序段运行后x的值为()。inta[8]={1,2,3,4,5,6,7,8},i,x=0;for(i=0;ii++,i++)x=x+a[i];
①  36
②  16
③  20
④  18
【单选题】 下面程序段的运行结果是()。intm[]={5,8,7,6,9,2},i=1;do{m[i]+=2;}while(m[++i]for(i=0;ii++)printf("%d",m[i]);
①  71098114
②  71098112
③  51098112
④  51098114
【单选题】 以下程序中的循环执行了()次。#defineN2#defineMN+1#defineNUM(M+1)*M/2main(){inti,n=0;for(i=0;ii++)n++;printf("%d\n",n);}
①  5
②  6
③  8
④  9
【单选题】 下列程序执行后的输出结果是() 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
随机题目
【单选题】 _________ English is different from __________ English.
①  writing, speaking
②  written, spoken
【单选题】 He looked at the little girl, _________ where he had seen her before.
①  wondering
②  wondered
【单选题】 Decades ago there was a time ______ people believed that the natural sources would never be used up.
①  which
②  when
③  with which
④  whenever
【单选题】 I don’t know the place ________ he studied.
①  which
②  that
③  where
④  in where
【单选题】 Mr. Zhang, _______ we have learned a lot, is very popular among us.
①  who
②  from that
③  from whom
④  whom
【单选题】 The biggest day ____________ I’ve ever been to is Beijing.
①  where
②  that
【单选题】 I don’t know the reason ___________ she is absent again today.
①  that
②  why
【单选题】 The boy worked hard ______ he could get the prize.
①  so that
②  so as to
③  so as
④  in order to
【单选题】 _______ my parents refused to support me, I have to earn money by myself.
①  When
②  Even
③  Since
④  So
【单选题】 Doris kept reading the poem ______ she could bear it in her mind.
①  until
②  unless
③  when
④  and