C. breakÓï¾ä¿ÉÓÃÓÚifÌåÄÚ,Ëü½«Í˳öifÓï¾ä
D. breakÓï¾äÔÚÒ»¸öÑ»·ÌåÄÚ¿ÉÒÔ³öÏÖ¶à´Î
22. int x=0,s=0; while(!x!=0) s+=++x; cout<
Ôò_____b______¡£
A. ÔËÐгÌÐò¶ÎºóÊä³ö0 B. ÔËÐгÌÐò¶ÎºóÊä³ö1
C. ³ÌÐò¶ÎÖеĿØÖƱí´ïʽÊÇ·Ç·¨µÄ D. ³ÌÐò¶ÎÖ´ÐÐÎÞÏÞ´Î
23. Éèe1ºÍe3ÊDZí´ïʽ£¬ÓëÓï¾äfor(e1;;e3)s;µÈͬµÄÓï¾äÊÇ______d______¡£ A. for(e1;e1;e3) s;B. for(e1;e3;e3) s;C. for(e1;0;e3) s;D. for(e1;1;e3) s; 24. Ö´ÐÐÏÂÁгÌÐò£¬ÊäÈëΪ1µÄÊä³ö½á¹ûÊÇ____a_____¡£
#include
{case 1:cout< case 3:cout< } A. 1 B. 2 C. 2 3 4 5 D. 1 2 3 4 25. Ñ»·Óï¾äfor(<±í´ïʽ1>;<±í´ïʽ2>;<±í´ïʽ3>)<Óï¾ä>ÖÐ,<Óï¾ä>µÄÖ´ÐÐÇé¿öÊÇ__c____. A. ÖÁÉÙÖ´ÐÐÒ»´Î B. ÖÁÉÙÖ´ÐÐÁ½´Î C. ¿ÉÄÜÖ´ÐÐ,Ò²¿ÉÄܲ»Ö´ÐÐ D. ²»Ö´ÐÐ 26. Ñ¡Ôñ³öºÏ·¨µÄifÓï¾ä(ÉèÓÐint x,y£»),ÕýÈ·Êä³öxÓëyµÄ´óС¹Øϵ___b_____¡£ A. if(x!=y) if(x>y) cout<<\£» else cout<<\ B. if(x!=y) if(x>y) cout<<\ else cout<<\else cout<<\ C. if(x!=y) if(x>y) cout<<\else cout<<\cout<<\ D. if(x!=y); if(x>y)cout<<\ else cout<<\ else cout<<\ 27. ÏÂÃæ³ÌÐòµÄÔËÐнá¹ûÊÇ___a____ #include int i=0; while(++i) { if(i==10) break; if(i%3!=1) continue; cout<< i; } } A. 1 4 7 B. 1 1 1 C. 3 3 3 D. 2 4 6 28. ÒÔϳÌÐòÊä³öµÄ½á¹ûÊÇa=___a____,b=_______ #include { for(int a=1,b=1; a<=5; a++) { if (b>=8) break; if(b%2==1){b+=7; continue;} b-=3; } cout<<\ } A. 2 8 B. 1 7 C. 8 2 D. 7 1 29. int x=-1; do {x=x*x;} while(!x); ÏÂÁÐ˵·¨ÕýÈ·µÄÊÇ_____c______¡£ A. ÊÇËÀÑ»· B. Ñ»·Ö´ÐÐÁ½´Î C. Ñ»·Ö´ÐÐÒ»´Î D. ÓÐÓï·¨´íÎó 30. ÏÂÃæ³ÌÐò¶Î____d_______¡£ for(t=1;t<=100;t++) {cin>>x; if(x<0)continue; cout< A. µ±x<0ʱÕû¸öÑ»·½áÊø B. x>=0ʱʲôҲ²»Êä³ö C. coutÓÀÔ¶Ò²²»Ö´ÐÐ D. ×î¶àÔÊÐíÊä³ö100¸ö·Ç¸ºÕûÊý 31. ÏÂÁÐforÑ»·µÄÑ»·ÌåÖ´ÐдÎÊýΪ____d______. For(int i=0,j=10;i=j=10;i++,j--) A. 0 B. 1 C. 10 D. ÎÞÏÞ 32. ÒÔϳÌÐòµÄÊä³ö½á¹ûÊÇ___a_____¡£ #include int x=1,y=0,a=0,b=0; switch(x) { case 1£º switch(y) { case 0:a++;break; case 1:b++;break; } case 2:a++;b++;break; } cout< } A. 2,1 B. 1,1 C. 1,0 D. 2,2 33. breakÓï¾äÖ»ÄÜÓÃÔÚ__d_____ A. ¿ª¹ØÓï¾äÖÐ B. º¯ÊýÌåÖÐÔÊÐíÓï¾ä³öÏÖµÄÈÎһλÖà C. Ñ»·Óï¾äÖÐ D. ¿ª¹ØÓï¾ä»òÑ»·Óï¾äÖÐ 34. ÏÂÃæ³ÌÐò¶ÎµÄÔËÐнá¹ûÊÇ_____a______¡£ #include int I,j,a=0; for(I=0;I<2;I++) { for(j=0;j<4;j++) { if(j%2) break; a++; } a++; } cout< } A. 4 B. 5 C. 6 D. 7 35. ÓëÒÔϳÌÐò¶ÎµÈ¼ÛµÄÊÇ____a____¡£ while(a) { if(b) continue; c; } A. while(a) {if(!b)c£»} B. while(c) {if(!b) break£» c£» } C. while(c) {if(b) c£»} D. while(a) {if(b) break£» c; } 36.ΪÁ˱ÜÃâǶÌ×µÄif-elseÓï¾äµÄ¶þÒåÐÔ£¬C++ÓïÑԹ涨else×ÜÊÇÓë_c_×é³ÉÅä¶Ô¹Øϵ¡£ A. ËõÅÅλÖÃÏàͬµÄif B. ÔÚÆä֮ǰδÅä¶ÔµÄif C. ÔÚÆä֮ǰδÅä¶ÔµÄ×î½üµÄif D. ͬһÐÐÉϵÄif 37. ÏÂÊö¹ØÓÚÑ»·ÌåµÄÃèÊöÖÐ,___c____ÊÇ´íÎóµÄ. A. Ñ»·ÌåÖпÉÒÔ³öÏÖbreakÓï¾äºÍcontinueÓï¾ä B. Ñ»·ÌåÖл¹¿ÉÒÔ³öÏÖÑ»·Óï¾ä C. Ñ»·ÌåÖв»ÄܳöÏÖgotoÓï¾ä D. Ñ»·ÌåÖпÉÒÔ³öÏÖ¿ª¹ØÓï¾ä 38. ÒÔϳÌÐòµÄÊä³ö½á¹ûÊÇ__a_¡£ #include void main() { int k=4,m=1,p; p=func(k, m); cout< p=func(k,m); cout< } A. 8,17 B. 8,16 C. 8,20 D. 8,8 39. ÒÑÖªint f(int);ºÍint g(int);·Ö±ðÊǺ¯ÊýfºÍgµÄÔÐÍ¡£ÏÂÁÐÓï¾äÖУ¬½«º¯Êýf×÷ΪÓï¾äµ÷ÓõÄÓÐ_____d_____¡£ A. f(3)+g(3); B. p/=f(3); C. g(f(3)); D. f(g(3)); 40.ÒÔϺ¯Êýµ÷ÓÃÓï¾äÖÐʵ²ÎµÄ¸öÊýÊÇ_a__¡£ excc((v1,v2),(v3,v4,v5),v6)£» A. 3 B. 4 C. 5 D. 6 41. ÏÂÁÐÓйرàÒëÔ¤´¦ÀíÃüÁîµÄ˵Ã÷ÖУ¬ÕýÈ·µÄÊÇ_____a_____¡£ A. ÒÔ¡°#¡±¿ªÍ·µÄÐУ¬¿É³öÏֵĺ¯Êý¶¨ÒåÄÚ»òº¯Êý¶¨ÒåÍâ B. ÒÔ¡°#¡±¿ªÍ·µÄÐУ¬ºóÃæ²»¿ÉÓзֺŠC. ÒÔ¡°#¡±¿ªÍ·£¬¿É³öÏÖÔÚÒ»ÐÐÖеÄÈκÎλÖà D. ÒÔ¡°#¡±¿ªÍ·£¬±Ø·ÅÔÚ³ÌÐò¿ªÍ· 42. ÔÚÏÂÃæµÄº¯ÊýÔÐÍÉùÃ÷ÖУ¬´æÔÚ×ÅÓï·¨´íÎóµÄÊÇ____d______¡£ A. void BC(int a,int);B. void BD(int ,int); C. void BE(int ,int=5); D. int BF(int x;int y); 43. ²ÉÓú¯ÊýÖØÔصÄÄ¿µÄÔÚÓÚ___d_____¡£ A. ʵÏÖ¹²ÏíB. ¼õÉÙ¿Õ¼ä C. Ìá¸ßËÙ¶È D. ʹÓ÷½±ã£¬Ìá¸ß¿É¶ÁÐÔ 44. ÉèÓк궨ÒåºÍÓï¾ä£º #define P(x,y) x/y #define PP(a,b) a*b int c=P(2+3,2+3)+PP(2+3,2+3); Ôò±äÁ¿cµÄÖµÊÇ___b_____ ¡£ A. 26B. 17C. 17.5D. 31 45. ÏÂÁжÔÖØÔغ¯ÊýµÄÃèÊöÖУ¬___a_____ÊÇ´íÎóµÄ¡£ A. ÖØÔغ¯ÊýÖв»ÔÊÐíʹÓÃĬÈϲÎÊý B. ÖØÔغ¯ÊýÖбàÒëÊǸù¾Ý²ÎÊý±í½øÐÐÑ¡ÔñµÄ C. ²»ÒªÊ¹ÓÃÖØÔغ¯ÊýÀ´ÃèÊöºÁÎÞÏà¸ÉµÄº¯Êý D. ¹¹Ô캯ÊýÖØÔؽ«»á¸ø³õʼ»¯´øÀ´¶àÖÖ·½Ê½ 46. ¶ÔÓÚÒ»¸ö¹¦Äܲ»Ì«¸´ÔÓ£¬²¢ÇÒÒªÇó¼Ó¿ìÖ´ÐÐËٶȣ¬Ñ¡ÓÃ______a_____ºÏÊÊ¡£ A. ÄÚÁªº¯ÊýB. ÖØÔغ¯Êý C. µÝ¹éµ÷ÓÃD. ǶÌ×µ÷Óà 47. ÏÂÃæµÄÄĸö±£Áô×Ö²»ÄÜ×÷Ϊº¯ÊýµÄ·µ»ØÀàÐÍ£¿_____c_____¡£ A. void B. int C. new D. long 48.¹ØÓÚº¯Êý·µ»ØÖµµÄµÄÃèÊöÕýÈ·µÄÊÇ_c__¡£ A. º¯Êý·µ»Ø±í´ïʽµÄÀàÐÍÒ»¶¨Ó뺯ÊýµÄÀàÐÍÏàͬ B. º¯Êý·µ»ØÖµµÄÀàÐ;ö¶¨ÁË·µ»ØÖµ±í´ïʽµÄÀàÐÍ C. µ±º¯ÊýÀàÐÍÓë·µ»ØÖµ±í´ïʽÀàÐͲ»Í¬£¬½«¶Ô·µ»ØÖµ±í´ïʽµÄÖµ½øÐÐÀàÐÍת»» D. º¯Êý·µ»ØÖµÀàÐ;ÍÊÇ·µ»ØÖµ±í´ïʽÀàÐÍ 49.Óйغ¯ÊýÖØÔصÄÕýȷ˵·¨ÊÇ__b_¡£ A. º¯ÊýÃû²»Í¬£¬µ«²ÎÊýµÄ¸öÊýºÍÀàÐÍÏàͬ B. º¯ÊýÃûÏàͬ£¬µ«²ÎÊýµÄ¸öÊý²»Í¬»ò²ÎÊýµÄÀàÐͲ»Í¬ C. º¯ÊýÃûÏàͬ£¬²ÎÊýµÄ¸öÊýºÍÀàÐÍÒ²Ïàͬ D. º¯ÊýÃûÏàͬ£¬º¯ÊýµÄ·µ»ØÖµ²»Í¬£¬¶øÓ뺯ÊýµÄ²ÎÊýºÍÀàÐÍÎÞ¹Ø 50. ÒÔÏÂÐðÊöÖв»ÕýÈ·µÄÊÇ____d____¡£ A. ÔÚº¯ÊýÖУ¬Í¨¹ýreturnÓï¾ä´«»Øº¯ÊýÖµ B. ÔÚº¯ÊýÖУ¬¿ÉÒÔÓжàÌõreturnÓï¾ä C. Ö÷º¯ÊýÃûmainºóµÄÒ»¶ÔÔ²À¨ºÅÖÐÒ²¿ÉÒÔ´øÓÐÐβΠD.µ÷Óú¯Êý±ØÐëÔÚÒ»Ìõ¶ÀÁ¢µÄÓï¾äÖÐÍê³É £2.Ìî¿ÕÌâ 1. ÒÔϳÌÐòÊä³öµÄ½á¹ûÊÇa=_2_£¬b=_8_¡£ #include { for(int a=1,b=1;a<=5;a++) { if(b>=8) break; if(b%2==1){b+=7;continue;} b-=3; } cout<<\} 2. ÉèÓÐÑ»·Óï¾ä£º for (int i=0,x=0,s=0;i<=9&&x!=55;i++) { cin>>x; s+=x; } ÔÚÕâ¸öÑ»·Óï¾äÖУ¬Ñ»·Ìå×î¶àÖ´ÐÐ _10__´Î£¬×îÉÙÖ´ÐÐ___1___´Î¡£ 3. ÉèÓÐÓï¾ä£º int i=1,s=1; for( ; s+i<6,i=5 ; i++) s+=i£» ÒÔÉÏforÑ»·Óï¾äµÄÑ»·´ÎÊýΪ _ÎÞÊý´Î_¡£ 4. ÏÂÁгÌÐòÔËÐкóµÄÊä³ö½á¹ûÊÇ_s=7_¡£ #include for (k=7;k>=0;k--) { switch(k) {case 1: case 4: case 7:s++;break; case 2: case 3: case 6:break; case 0: case 5:s+=2;break; } } cout<<\ } 5. ÈôÓÃ0ÖÁ9Ö®¼ä²»Í¬µÄÈý¸öÊý¹¹³ÉÒ»¸öÈýλÊý£¬ÒÔϳÌÐò½«Í³¼Æ³ö¹²ÓжàÉÙÖÖ·½·¨¡£ÇëÌî¿Õ¡£ #include { int i,j,k,count=0; for(i=1;i<=9;i++) for(j=0;j<=9;j++) if (________)continue; else for(k=0;k<=9;k++) if(________)count++; cout< 6. Ö¸³öÏÂÃæ³ÌÐòµÄÊä³ö½á¹û_1 1 2 3 5 8 13 21 34 55__¡£ #include { int i1=1,i2=1,i3,i; cout< cout< 7. ContinueÓï¾äÖ»ÄÜÔÚ__Ñ»·__Óï¾äÖС£ 8. ÈôÓÐint i=10, j=0; ÔòÖ´ÐÐÍêÓï¾ä if(j=0) i++; else i--; ºóiµÄֵΪ__9___¡£ 9.ÒÔϳÌÐòÊä³öµÄµÚÒ»ÐÐ_4_£¬µÚ¶þÐÐ_1_¡£ #include cout< 10. ÿ¸ö»ù±¾Óï¾äµÄ½áÊø±êÖ¾ÊÇ_·ÖºÅ__¡£ 11. ÒÔϳÌÐòµÄÊä³ö½á¹ûÊÇ __200,100____¡£ #include void f(int &a,int &b){int t=a;a=b;b=t;} void main(void) { int x=100,y=200; f(x,y); cout< 12. ÒÔϳÌÐòµÄÖ´Ðнá¹ûÊÇ__25___ ¡£ #include extern int x,y; cout< int x=20,y=5; int add(int a,int b) { int s=a+b; return s; } 13. ÒÑÖªº¯ÊýfµÄ¶¨ÒåÊÇ£º int f(int n) { n*=2; return n+1;} ÔòÖ´ÐÐ int m=6,n=2; m=f(n); ºó£¬mºÍnµÄÖµ·Ö±ðÊÇ_5__2___¡£ 14. º¯Êýmy_cmp( )µÄ¹¦ÄÜÊDZȽÏ×Ö·û´®sºÍt µÄ´óС£¬µ±sµÈÓÚtʱ·µ»Ø0£¬·ñÔò·µ»ØsºÍtµÄµÚÒ»¸ö²»Í¬×Ö·ûµÄASCIIÂë²îÖµ£¬¼´µ±s>tʱ·µ»ØÕýÖµ£¬µ±s my_cmp(char *s, char *t) { while (*s==*t) { if (*s=='\\0') return(0); ++s, ++t; } return__________; } *s-*t 15. ÈôÓк궨Ò壺 #define T(x,y,z) x*y*z/4 Ôò±í´ïʽT(8-3,2*4,2+3)µÄÖµÊÇ__-40__¡£ 16. ÏÂÃæ³ÌÐòÔËÐкóÊä³öµÄµÚ¶þÐÐÊÇ__10 35 5___ ¡£ #include void main() { int a=10,b=20;