【单选题】【消耗次数:1】
以下程序中的循环执行了()次。#defineN2#defineMN+1#defineNUM(M+1)*M/2main(){inti,n=0;for(i=0;ii++)n++;printf("%d\n",n);}
5
6
8
9
参考答案:
复制
纠错
相关题目
【单选题】 以下程序的运行结果是()。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
【简答题】 查找n在数组a中最后一次出现的位置(数组首元素的位置为零)。 例如:如果a数组中的元素为:1,5,2,5,6,8,7,4,3,0, 当n=5时,程序的输出结果为:5 is No.3 。 当n=10时,程序的输出结果应为:10 not found !。 #includevoid main( ) { int a[10]={1,5,2,5,6,8,7,4,3,0}; int i,k,n,f=0; scanf(%d, for(i=0;ii++) /************found************/ if([填空1]) { f=1; /************found************/[填空2] } if(f) printf(%d is No. %d\n, n,k); else printf( %d not found !\n }
【单选题】 下面程序段的运行结果是()。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
【单选题】 以下程序的运行结果是: main() {int m=5; if(m++5) printf(%d\n else printf(%d\n,m--); }
①  4
②  5
③  6
④  7
【单选题】 以下程序运行结果是( )。 Main() {int if(m++5) printf(%d\n else printf(%d\n,m--); }
①  4
②  5
③  6
④  7
【单选题】 以下程序的运行结果是()。voidmain(){intm,n=1,t=1;if(t==0)t=-t;elsem=n=0?7:3;printf("%d\n",m);}
①  3
②  -1
③  7
④  1
【单选题】 以下程序的输出结果是_______? f(int b[],int m,int n) { int i,s=0; for(i=m;in;i=i+2) s=s+b[i]; return s; } int main() { int x,a[]={1,2,3,4,5,6,7,8,9}; x=f(a,3,7); printf(%d\n,x); }
①  7
②  8
③  9
④  10
【单选题】 以下程序的运行结果是()。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
【简答题】 int a[10]={0,1,2,3,4,5,6,7,8,9};int *p;int i;p=a;printf(%d\n,*p++);printf(%d\n,*++p);程序输出结果为[填空1]和[填空2]。
【单选题】 有以下程序,执行后输出结果是() main( ) { int m[][3]={1,4,7,2,5,8,3,6,9}; int i,j,k=2; for(i=0;i { printf(%d ,m[k][i]); } }
①  4 5 6
②  2 5 8
③  3 6 9
④  7 8 9
随机题目
【单选题】 —What’syourbrotherdoing?—He___sciencefiction.
①  reads
②  read
③  isreading
④  wasreading
【单选题】 —Imgoingcampingthisweekend.________
①  Canyoufish?
②  Haveagoodtime
③  No,Imtoobusy
④  Dontgiveupnow
【单选题】 —Whatdoyouthinkofthe_____TheMoonlightSonatabyBeethoven?—Itsoundsreallywonderful.
①  subject
②  music
③  book
④  animals
【单选题】 —Whenshallwestart?—Lets_____it8:30.Isthatallright?
①  take
②  make
③  have
④  meet
【单选题】 Wehaveboughttwo________forthecomingparty.
①  boxofapple
②  boxesofapples
③  boxofapples
④  boxesofapple
【单选题】 ---Ohdear!I’vejustbrokenawindow.----___.Itcan’tbehelped.
①  Nevermind
②  Allright
③  That’sfine
④  Notatall
【单选题】 Yourfailure,inmyopinion,liesinthe_____ofself-confidence.
①  lack
②  sense
③  regret
④  prevention
【单选题】 Mygrandpacanthearclearly.Theressomethingwrongwithhis______.
①  mouth
②  eyes
③  ears
④  nose
【单选题】 Goodtimingis______toourplans.
①  especial
②  essential
③  complete
④  equivalent
【单选题】 Imlookingforababysitter,Shemustbe_____tooold_____tooyoung.
①  neither;nor
②  both;and
③  either;or
④  notonly;butalso