ÖУ¬ÔÚ±àÒëʱ½«²úÉú´íÎóÐÅÏ¢µÄÊÇ(C)
A)if(x++); B)if(x>y&&y!=0); C)if(x>y) x- - D)if(y<0) {;} else y++; else x++; [07/04] ÒÔÏÂÑ¡ÏîÖУ¬µ±xΪ´óÓÚ1µÄÆæÊýʱ£¬ÖµÎª0µÄ±í´ïʽ(D)
A)x%2==1 B)x/2 C)x%2!=0 D)x%2==0 [07/04]ÒÔÏÂÐðÊöÖÐÕýÈ·µÄÊÇ(C)
A£©breakÓï¾äÖ»ÄÜÓÃÓÚswitchÓï¾äÌåÖÐ
B)continueÓï¾äµÄ×÷ÓÃÊÇ£ºÊ¹³ÌÐòµÄÖ´ÐÐÁ÷³ÌÌø³ö°üº¬ËüµÄËùÓÐÑ»·
C)break Óï¾äÖ»ÄÜÓÃÔÚÑ»·ÌåÄÚºÍswitchÓï¾äÌåÄÚ D£©ÔÚÑ»·ÌåÄÚʹÓÃbreakÓï¾äºÍcontinueÓï¾äµÄ×÷ÓÃÏàͬ
[07/04]ÓÐÒÔϳÌÐò(A) main() {int k=5,n=0; do {switch(k)
{case1: case3:n+=1; break; default;n=0;k--;
case2: case4:n+=2;k--;break; }
printf(¡°%d¡±,n); }while(k>0&&n<5); }³ÌÐòÔËÐкóµÄÊä³ö½á¹ûÊÇ
A£©235 B£©0235 C£©02356 D£©2356 [07/04] ÒÔϳÌÐòµÄÔËÐнá¹ûÊÇ ________#&_______ main() {int a=2,b=7,c=5; switch (a>0) {case 1: switch (b<0)
{case 1:switch(¡°@¡±); break; Case 2: printf(¡°!¡±); break; }
case 0: switch(c==5) { case 0: printf(¡°*¡±); break; case 1: printf(¡°#¡±); break; case 2: printf(¡°$¡±); break;
}
default : printf(¡°&¡±); }
printf(¡°\\n¡±); }
µÚ¶þ²¿·ÖÉÏ»ú
1. ±àд³ÌÐò£¬ÊäÈëÒ»¸öÕûÊý£¬´òÓ¡³öËüÊÇÆæÊý»¹ÊÇżÊý¡£
2. ±àдº¯Êý£¬ÊäÈëa,b,cÈý¸öÊý£¬´òÓ¡³ö×î´óÕß¡£
3. ÊäÈëÁ½¸öÊý£¬·Ö±ð·ÅÈëx,yÖУ¬ÈôÁ½¸öÊý²»ÏàµÈ£¬Ôò
Êä³öÆäÖнϴóµÄÒ»¸ö£¬ÈôÁ½¸öÏàµÈ£¬ÔòÊä³ö×Ö·û´®x==yºÍxµÄÖµ¡£
4. ÊäÈëÈý¸öÕûÊý£¬·Ö±ð·ÅÔÚ±äÁ¿a,b,cÖУ¬È»ºó°ÑÊäÈë
µÄÊý¾Ý°´ÓÉ´óµ½Ð¡µÄ˳Ðò·ÅÔÚ±äÁ¿a,b,cÖУ¬×îºóÊä³öa,b,cÖеÄÖµ¡£
5. ÊäÈëÒ»¸öÊý£¬ÅжÏËüÊÇ·ñÄܱ»3ºÍ7Õû³ý£¬ÈôÄÜÊä³ö
YES,·´Ö®Êä³öNO
6. ±àд³ÌÐò£¬¸ù¾ÝÊäÈëµÄζȶÈÊý¸ø³öÏàÓõĵȼ¶£¬´ó
ÓÚµÈÓÚ40¶ÈµÄµÈ¼¶ÎªA£¬0¶ÈÒÔϵĵȼ¶ÎªF£¬ÆäÓàÿ10¶È·ÖÒ»¸öµÈ¼¶£¡£¨²Î¿¼ÀýÌâ4.5£¬×¢ÒâbreakµÄÓ÷¨£©
µÚ5Õ ѻ·½á¹¹
Ò»¡¢Ñ¡ÔñÌâ
1¡¢ÔÚCÓïÑÔµÄÑ»·Óï¾äfor£¬while,do-whileÖУ¬ÓÃÓÚÖ±½ÓÖжÏ×îÄÚ²ãÑ»·µÄÓï¾äÊÇ£¨£©¡£ A)switch B)continue C)break D)if 2¡¢ÏÂÃæ³ÌÐòµÄÖ´Ðнá¹ûÊÇ£¨ £©¡£ main() { int i=0; while(i++<=1)
µÚ 9 Ò³ ¹² 38 Ò³
printf(\ printf(\
A)1 2 3 B)0 1 2 C)1 1 2 D)1 2 2
3¡¢Èôi¡¢jÒѶ¨ÒåΪintÐÍ£¬ÔòÒÔϳÌÐò¶ÎÖÐÑ»·Ìå×Ü i+=11; a+=i; }
printf(\ }
µÄÖ´ÐдÎÊýÊÇ£¨ £©¡£ for(i=5;i;i--) for(j=0;j<4;j++) {....}
A)20 B)24 C)25 D)30 4¡¢ÏÂÁгÌÐòµÄÖ´Ðнá¹ûÊÇ£¨ £©¡£ main() { int x=10; do { x--; }while(--x); printf(\ A)-1 B)1 C)8 D)0
5¡¢ÏÂÁгÌÐòµÄÖ´Ðнá¹ûÊÇ£¨ £©¡£ main() { int i,sum;
for(i=1;i<=3;sum++) sum+=i;
printf(\ A)6 B)3 C)ËÀÑ»· D)0 6¡¢ÏÂÁгÌÐò¶ÎµÄÖ´Ðнá¹ûÊÇ£¨ £©¡£ main()
{ int x=3;
do{ printf(\ }while(!(--x)); }
A)1 B)3 0 C)1 -2 D)ËÀÑ»· 7¡¢ÏÂÁгÌÐòµÄÖ´Ðнá¹ûÊÇ£¨ £©¡£ #include
{ int i=0,a=0; while(i<20) { for(;;)
{ if((i)==0)break; else i--; }
A)21 B)32 C)33 D)11 8¡¢ÏÂÁгÌÐòµÄÖ´Ðнá¹ûÊÇ£¨ £©¡£ main() { int x=3;
do{ printf(\ }while(--x); }
A)1 B)30 3 C)1 -2 D)ËÀÑ»· 9¡¢ÏÂÁгÌÐòµÄÊä³ö½á¹ûÊÇ£¨ £©¡£ main()
{ int x=15; while(x>10&&x<50) { x++;
if(x/3){ x++;break;} else continue; }
Printf(¡°%d\\n¡±,x); } ¶þ¡¢³ÌÐòÌâ
1¡¢±àд³ÌÐòÇóÁ½¸öÕûÊýµÄ×î´ó¹«Ô¼Êý¡£
2¡¢ÕûÔª»»ÁãÇ®ÎÊÌâ¡£°Ñ1Ôª¶Ò»»³É1·Ö¡¢2·Ö¡¢5·ÖµÄÓ²±Ò£¬¹²ÓжàÉÙÖÖ²»Í¬µÄ»»·¨£¬±àд³ÌÐòÀ´ÊµÏÖ¡£
2,3,5,85,13218,13...... 3¡¢ÓÐÒ»¸ö·ÖÊýÐòÁУº123£¬±àд
³ÌÐòÇó´ËÊýÁеÄÇ°20ÏîÖ®ºÍµÄ³ÌÐò¡£
µÚ5Õ ѻ·½á¹¹Á·Ï°Ìâ2
Ò»¡¢Ñ¡ÔñÌâ
£¨1£©ÔÚCÓïÑÔÖУ¬ÏÂÁÐÐðÊöÕýÈ·µÄÊÇ£¨£© A£©²»ÄÜʹÓÃdo-whileÓï¾ä¹¹³ÉµÄÑ»·¡£
B£©do-whileÓï¾ä¹¹³ÉµÄÑ»·£¬±ØÐëÓÃbreakÓï¾ä²ÅÄÜÍ˳ö¡£
C£©do-whileÓï¾ä¹¹³ÉµÄÑ»·£¬µ±whileÓï¾äÖеıí´ï
µÚ 10 Ò³ ¹² 38 Ò³
ʽֵΪ·ÇÁãʱ½áÊøÑ»·¡£
D£©do-whileÓï¾ä¹¹³ÉµÄÑ»·£¬µ±whileÓï¾äÖеıí´ï }
A)10 B)9 ʽֵΪÁãʱ½áÊøÑ»·¡£ £¨2£©ÓÐÈçϳÌÐò¶Î£º int i=0; while(!i==0) { i=i+1;
Printf(¡°%d\\n¡±,i); }
ÔòÏÂÁÐ˵·¨ÖÐÕýÈ·µÄÊÇ£¨£© A£©whileÑ»·Ö´ÐÐ2´Î B£©Ñ»·ÊÇÎÞÏÞÑ»·
C£©Ñ»·ÌåÓï¾äÒ»´ÎÒ²²»Ö´ÐÐ D£©Ñ»·ÌåÓï¾äÖ´ÐÐÒ»´Î (3)ÓÐÈçϳÌÐò¶Î£º int i=0; while(i++<=2);
printf(\
ÔòÕýÈ·µÄÖ´Ðнá¹ûÊÇlast=£¨ £©¡£ A£©2 B£©3 C£©4 D£©ÎÞ½á¹û
£¨4£©Ö´ÐÐÏÂÃæµÄ³ÌÐòºó£¬aµÄֵΪ£¨ £©¡£ main() { int a,b;
for(a=1,b=1;a<=100;a++) { if(b>=20)break; if(b%3==1) { b+=3; continue; } b-=5; } } A)7 B)8 C)9 D)10 (5)¶¨ÒåÈçϱäÁ¿£º int x=10;
ÔòÏÂÁÐÑ»·µÄÊä³ö½á¹ûÊÇ£¨ £©¡£ while(x>7) { x--;
printf(\
9 8 8 7 C)10 D)9 9 8 8 7 7 6
(6)ÏÂÃæ³ÌÐòµÄÊä³ö½á¹ûÊÇ£¨ £©¡£ main() { int i;
for(i=1;i<6;i++) { if(i%2)
{ printf(\ printf(\ }
printf(\ }
A)#*#*# B)#### C)***** D)*#*#* (7)ÏÂÃæ³ÌÐòµÄÊä³ö½á¹ûÊÇ£¨ £©¡£ #include
for(a=1,b=1;a<=100;a++) { if(b>=20)break; if(b%3==1)
{ b+=3;continue;} b-=5; }
printf(\ }
A)7 B)8 C)9 D)10 (8)ÏÂÁгÌÐòµÄÊä³ö½á¹ûÊÇ£¨ £©¡£ main() { int x=9; for(;x>0;x--) if(x%3==0)
{ printf(\
µÚ 11 Ò³ ¹² 38 Ò³
continue; } }
A)741 B)852 C)963 D)875421 (10)ÏÂÁгÌÐòµÄÖ´Ðнá¹ûÊÇ£¨ £©¡£ main() { int x=3;
do{ printf(\ }while(!x); }
A)321 B)3 C)²»Êä³öÈκÎÄÚÈÝ D)ÏÝÈëËÀÑ»· ¶þ¡¢³ÌÐòÌâ
1¡¢ÒÔϳÌÐòµÄ¹¦ÄÜÊÇ£º´Ó¼üÅÌÉÏÊäÈëÈô¸É¸öѧÉúµÄ³É¼¨£¬Í³¼Æ²¢Êä³ö
×î¸ß³É¼¨ºÍ×îµÍ³É¼¨£¬µ±ÊäÈ븺Êýʱ½áÊøÊäÈë¡£Çë²¹³ä³ÌÐòÖеĿÕȱÓï¾ä¡£ main()
{ float x,amax,amin; scanf(\ amax=x; amin=x; while(_______) { if(x>amax)amax=x; if(_______)amin=x; scanf(\ }
printf(\ }
2¡¢¡°°Ù¼¦ÎÊÌ⡱£º1Ö»´ó¹«¼¦Öµ5¸öÇ®£¬1ֻĸ¼¦Öµ3¸öÇ®£¬3ֻС¼¦Öµ1¸öÇ®¡£
ÏÖÔÚ100¸öÇ®,ÒªÂò100Ö»¼¦£¬ÊÇ·ñ¿ÉÒÔ£¿Èô¿ÉÒÔ£¬¸ø³öÒ»¸ö½â£¬ÒªÇó3ÖÖ¼¦¶¼ ÓС£Ð´³öÇó½â¸ÃÌâµÄ³ÌÐò¡£
main() {int k=5,n=0; do {switch(k)
{case1: case3:n+=1; break; default;n=0;k--;
case2: case4:n+=2;k--;break; }
printf(¡°%d¡±,n); }while(k>0&&n<5); }³ÌÐòÔËÐкóµÄÊä³ö½á¹ûÊÇ
A£©235 B£©0235 C£©02356 D£©2356 2£®ÓÐÒÔϳÌÐò mian() {int i,j;
for(i=1;i<4;i++)
{for(j=i;j<4;j++) printf(¡°%d*%d=%d ¡°,i,j,i*j); printf(¡°\\n¡±);}}³ÌÐòÔËÐкóµÄÊä³ö½á¹ûÊÇ(B)
A) 1*1=1 1*2=2 1*3=3 B) 1*1=1 1*2=2 1*3=3
2*1=2 2*2=4 2*2=4
2*3=6
3*1=3 3*3=9
C£© 1*1=1 D) 1*1=1 1*2=2 2*2=4 2*1=2 2*2=4
1*3=3 2*3=6 3*3=9 3*1=3 3*2=6 3*3=9 3£®ÓÐÒÔϳÌÐò #include
if(y%3= =0) printf(\³ÌÐòµÄÔËÐнá¹ûÊÇ A£©741 B£©963 C£©852 D£©875421 4£®ÓÐÒÔϳÌÐò #include
µÚ 12 Ò³ ¹² 38 Ò³
µÚ5Õ ѻ·½á¹¹Á·Ï°Ìâ3
1£®ÓÐÒÔϳÌÐò(A)