void swap(int *x,int *y) { int t;
t=*x;*x=*y;*y=t; }
main() { int i,a[10];
printf(¡°Enter 10 integers:¡±); for(i=0;i<10;i++) scanf(¡°%d¡±,&a[i]); ___(12)___
printf(¡°After sorted:¡±); for(i=0;i<10;i++) printf(¡°%d ¡±,a[i]); printf(¡°\\n¡±); } ¡¾¹©Ñ¡ÔñµÄ´ð°¸¡¿
(9) [A] void swap(int *x,int *y) [B] ;
[C] void swap(int *x,int *y); [D] void swap(int *x, *y) (10) [A] int &a,int n
[C] int *a,int n
(11) [A] swap(*a[index],*a[k])
[C] swap(index,k)
[B] int *a,int *n [D] int a,int *n
[B] swap(a[index],a[k]) [D] swap(&a[index],&a[k])
(12) [A] sort(a) [B] sort(a[10])
[C] sort(a[],10) [D] sort(a,10)
ÊÔÌâ4£¨Ã¿Ð¡Ìâ3·Ö£¬¹²12·Ö£©
ÔĶÁÏÂÁгÌÐò²¢»Ø´ðÎÊÌ⣬ÔÚÿСÌâÌṩµÄÈô¸É¿ÉÑ¡´ð°¸ÖУ¬Ìôѡһ¸öÕýÈ·´ð°¸¡£ ¡¾³ÌÐò¡¿ ³ÌÐò1
#include
{ int j,k,s1,s2; s1=s2=0;
for(j=1;j<=5;j++){ s1++;
for(k=1;k<=j;k++) s2++; }
printf(¡°%d %d¡±,s1,s2); }.
³ÌÐò2
#include
{ int j,k,s1,s2; s1=0;
25
for(j=1;j<=5;j++){ s1++;
for(k=1,s2=0;k<=j;k++) s2++; }
printf(¡°%d %d¡±,s1,s2); }.
³ÌÐò3
#include
{ int j,k,s1,s2; s1=0;
for(j=1;j<=5;j++){ s1++;
for(k=1;k<=j;k++,s2=0) s2++; }
printf(¡°%d %d¡±,s1,s2); }.
³ÌÐò4
#include
{ int j,k,s1,s2; s1=s2=0;
for(j=1;j<=5;j++,s1=0){ s1++;
for(k=1;k<=j;k++) s2++; }
printf(¡°%d %d¡±,s1,s2); }.
¡¾¹©Ñ¡ÔñµÄ´ð°¸¡¿
(13) ³ÌÐò1ÔËÐÐʱ£¬Êä³ö£º
[A] 0 15 [B]5 0 (14) ³ÌÐò2ÔËÐÐʱ£¬Êä³ö£º [A] 0 15 [B]5 0 (15) ³ÌÐò3ÔËÐÐʱ£¬Êä³ö£º [A] 0 15 [B]5 0 (16) ³ÌÐò4ÔËÐÐʱ£¬Êä³ö£º [A] 0 15 [B]5 0
[C]5 5 [C]5 5 [C]5 5 [C]5 5
[D] 5 15 [D] 5 15 [D] 5 15 [D] 5 15
ÊÔÌâ5£¨Ã¿Ð¡Ìâ3·Ö£¬¹²12·Ö£©
ÔĶÁÏÂÁгÌÐò²¢»Ø´ðÎÊÌ⣬ÔÚÿСÌâÌṩµÄÈô¸É¿ÉÑ¡´ð°¸ÖУ¬Ìôѡһ¸öÕýÈ·´ð°¸¡£ ¡¾³ÌÐò¡¿
³ÌÐò1
#include
26
main()
{ int i,m=15,y=-1; for(i=2;i<=m/2;i++) if(m%i= =0) y=0; else y=1; printf(¡°%d¡±,y); }
³ÌÐò2
#include
{ int i,m=15,y=-1; for(i=2;i<=m/2;i++)
if(m%i= =0) {y=0;break;} printf(¡°%d¡±,y); }
³ÌÐò3
#include
{ int i,m=15,y=-1; for(i=2;i<=m/2;i++) if(m%i= =0) break; if(i>m/2) y=1; else y=0;
printf(¡°%d¡±,y); }
³ÌÐò4
#include
{ int i,m=15,y=-1; for(i=2;i<=m/2;i++)
if(m%i= =0) {break;y=0;} printf(¡°%d¡±,y); }
¡¾¹©Ñ¡ÔñµÄ´ð°¸¡¿
(17) ³ÌÐò1ÔËÐÐʱ£¬Êä³ö£º
[A]1 [B]0 (18) ³ÌÐò2ÔËÐÐʱ£¬Êä³ö£º [A]15 [B]0 (19) ³ÌÐò3ÔËÐÐʱ£¬Êä³ö£º [A]-1 [B]1 (20) ³ÌÐò4ÔËÐÐʱ£¬Êä³ö£º [A]0 [B]15
[C]15 [C]-1 [C]0 [C]1
[D]-1 [D]1 [D]15 [D]-1
ÊÔÌâ6£¨Ã¿Ð¡Ìâ3·Ö£¬¹²12·Ö£©
ÔĶÁÏÂÁгÌÐò²¢»Ø´ðÎÊÌ⣬ÔÚÿСÌâÌṩµÄÈô¸É¿ÉÑ¡´ð°¸ÖУ¬Ìôѡһ¸öÕýÈ·´ð°¸¡£ ¡¾³ÌÐò¡¿
27
#include
char ch,a[10],*s[10]={¡°one¡±,¡±two¡±,¡±three¡±,¡±four¡±}; k=0;
while((ch=getchar())!=?\\n?&&k<9) if(ch>=?5?&&ch<=?8?) a[k++]=ch; a[k]=?\\0?;
for(k=0;a[k]!=?\\0?;k++) printf(¡°%ds¡±,s[(?9?-a[k])-1]); }
¡¾¹©Ñ¡ÔñµÄ´ð°¸¡¿
(21) ³ÌÐòÔËÐÐʱ£¬ÊäÈë5678£¬Êä³ö£º
[A] two three [C] one four three (22) ³ÌÐòÔËÐÐʱ£¬ÊäÈë8561#£¬Êä³ö£º
[A] two three [C] one four three (23) ³ÌÐòÔËÐÐʱ£¬ÊäÈë7902#£¬Êä³ö£º
[A] two three [C] one four three (24) ³ÌÐòÔËÐÐʱ£¬ÊäÈë7633#£¬Êä³ö£º
[A] two three [C] one four three
[B] two
[D] four three two one [B] two
[D] four three two one [B] two
[D] four three two one [B] two
[D] four three two one
ÊÔÌâ7£¨28·Ö£©
(1)¶¨Ò庯Êýfact(n)¼ÆËãnµÄ½×³Ë£ºn!=1*2*??*n£¬º¯Êý·µ»ØÖµÀàÐÍÊÇdouble¡£
(2)¶¨Ò庯Êýcal(e)¼ÆËãÏÂÁÐËãʽµÄÖµ£¬Ö±µ½×îºóÒ»ÏîµÄ¾ø¶ÔֵСÓÚe£¬º¯Êý·µ»ØÖµÀàÐÍÊÇdouble¡£ s=1+
(3)¶¨Ò庯Êýmain()£¬ÊäÈëÕýÕûÊýn£¬µ±¾«¶Èe·Ö±ðȡֵΪ10¡¢10¡¢10¡¢??¡¢10ʱ£¬·Ö±ð¼ÆËã²¢Êä³öÏÂÁÐËãʽµÄÖµ£¬Ö±µ½×îºóÒ»ÏîµÄ¾ø¶ÔֵСÓÚ¾«¶Èe£¬ÒԱȽϲ»Í¬¾«¶ÈÏÂËã³öµÄ½á¹û£¬ÒªÇóµ÷Óú¯Êýcal(e)¼ÆËãÏÂÁÐËãʽµÄÖµ¡£
111???...... 2!3!4!-1-2-3-n
¼ÆËã»úµÈ¼¶¿¼ÊԲο¼´ð°¸£¨¶þ¼¶C£©
ÊÔÌâ1¡«6 (ÿСÌâ3·Ö)
¢Å A ¢Æ A ¢Ç B ¢È B ¢É A ¢Ê B ¢Ë C ¢Ì D ¢Í C ¢Î C ¢Ï D ¢Ð D ¢Ñ D ¢Ò C ¢Ó B ¢Ô A ¢Õ A ¢Ö B ¢× C ¢Ø D (21)D (22)C (23)B (24)A
28
Ïà¹ØÍÆ¼ö£º