CÓïÑÔº¯ÊýÏ°Ìâ¼°´ð°¸(20200506225202)

5.

#include void {

int t; while(m

*s, int

fun(int

m, int n)

{t=s[m]; s[m]=s[n]; s[n]=t; m++; n--;} } main() {

Int a[5]={1,2,3,4,5},k; fun(a,0,4);

for(k=0;k<5;k++) printf(\ }

6.

int fun(char s[]) {

int n=0;

while(*s<='9'&&*s>='0') {

n=10*n+*s-'0';

s++;

}

return(n); } main() {

char s[10]={'6','1','*','4','*','9','*','0','*'}; printf(\ }

7.

#include {

int y;

if(x==0||x==1) y=x*x-fun(x-2) return } main() {

int x,y;

y;

return(3);

Int fun(int x)

\

x=fun(3); y=fun(4);

printf(\ }

8.

fun(int n,int *s) {

int f1, f2;

if(n==1 || n==2) else {

fun(n-1, &f1); fun(n-2, &f2); *s=f1+f2; } } main() {

int x; fun(6,&x); printf(\ }

*s=1;

Èý¡¢Ìî¿ÕÌâ

1. ÒÔϳÌÐòʵÏÖÁ˼ÆËã x µÄ n ´Î·½£¬Ç뽫³ÌÐòÌîдÍêÕû¡£

float power(float x,int n)

{ int i; float t=1;

for(i=1;i<=n;i++)

t=t*x;

¡¾ 1 ¡¿ ; } main( ) {float x,y; int

n;

scanf(\ y=power(x,n); printf(\

}

2.

ÒÔϳÌÐòʵÏÖÁËÇóÁ½¸öÊýµÄ×î´ó¹«Ô¼Êý£¬Ç뽫³ÌÐòÌîдÍêÕû¡£

int divisor(int a,int b) { int r; r=a%b;

while( ¡¾ 2 ¡¿ )

{ a=b;b=r;r=a%b;} return b;

}

void main() { int a,b,d,t;

scanf(\ if (a

{ t=a; a=b; b=t; } d=divisor(a,b); printf(\ }

3. ÒÔϺ¯Êý my_cmp( )µÄ¹¦ÄÜÊDZȽÏ×Ö·û´® s ºÍ t µÄ´óС£¬µ± s µÈÓÚ t ʱ·µ»Ø 0£¬·ñÔò·µ

»Ø s ºÍ t µÄµÚÒ»¸ö²»Í¬×Ö·ûµÄ ASCII Âë²îÖµ£¬¼´ s>t ʱ·µ»ØÕýÖµ£¬ s

my_cmp(char *s,char *t) {

while(*s == *t) {

if ( ¡¾ 3¡¿ ) return 0; ++s; ++t; }

return ¡¾4¡¿ ; }

4. ÒÔϳÌÐòµÄ¹¦ÄÜÊÇ :ɾȥһάÊý×éÖÐËùÓÐÏàͬµÄÊý ,ʹֻ֮ʣһ¸ö¡£Êý×éÖеÄÊýÒÑ°´ÓÉСµ½´ó

µÄ˳ÐòÅÅÁÐ ,º¯Êý·µ»Øɾ³ýºóÊý×éÖÐÊý¾ÝµÄ¸öÊý¡£Ç뽫³ÌÐòÌîдÍêÕû¡£ ÀýÈç ,ÈôһάÊý×éÖеÄÊý¾ÝÊÇ

: :

2223445666677899101010 2345678910 ¡£

ɾ³ýºó ,Êý×éÖеÄÄÚÈÝÓ¦¸ÃÊÇ

#include

#define N 80 int fun(int a[], int n) {int i,j=1; for(i=1;i

if(a[j-1] ¡¾ 5 ¡¿ a[i])

a[j++]=a[i]; return ¡¾6 ¡¿;

}

main( ) {

int a[N]={2,2,2,3,4,4,5,6,6,6,6,7,7,8,9,9,10,10,10},i,n=19; printf(\ for(i=0;i

printf( ¡°%d ¡±,a[i]); n=fun(a,n);

printf(\ for(i=0; i

printf( ¡°%d ¡±,a[i]);

}

ËÄ¡¢±à³ÌÌâ

1. ÇëÓÃ×Ô¶¨Ò庯ÊýµÄÐÎʽ±à³ÌʵÏÖ£¬ 2. ÇëÓÃ×Ô¶¨Ò庯ÊýµÄÐÎʽ±à³ÌʵÏÖÇó 3. Çë±àдÁ½¸ö×Ô¶¨Ò庯Êý£¬

Çó s=m!+n!+k! £¬m¡¢n¡¢k ´Ó¼üÅÌÊäÈë £¨Öµ¾ùСÓÚ 7£©¡£ 10 ÃûѧÉú 1 Ãſγ̳ɼ¨µÄƽ¾ù·Ö¡£

·Ö±ðʵÏÖÇóÁ½¸öÕûÊýµÄ×î´ó¹«Ô¼ÊýºÍ×îС¹«±¶Êý£¬

²¢ÓÃÖ÷º¯Êý

µ÷ÓÃÕâÁ½¸öº¯Êý£¬Êä³ö½á¹û£¨Á½¸öÕûÊýÓɼüÅÌÊäÈëµÃµ½£©¡£ 4. ÒÑÖª¶þ½× Fibonacci ÊýÁУº

0

Fib(n)

1

Èô n=0 Èô n=1

ÆäËûÇé¿ö

Fib(n-1)+Fib(n-2)

Çë±àдһ¸öµÝ¹éº¯Êý£¬ÊµÏÖÇó

Fib(n) ¡£

µÚ 6 ÕÂ

Ò»¡¢Ñ¡ÔñÌâ

B

2.

C

3.

12. A 22. D

1. B 4. B 5. C 6. 16.

D C

7. D 8. C 9. D 10. D 20. A

11. A 21. A 30. A

13. C 23. C

14. D 24. B

15. D 25. A

17. B 18. A 19. A

26. ¡¾1¡¿A 26. ¡¾2¡¿D 27. ¡¾1¡¿B

27. ¡¾2¡¿D 33. ¡¾3¡¿A 36. ¡¾1¡¿D 38. ¡¾1¡¿C

27. ¡¾3¡¿C 31. D 34. ¡¾1¡¿D 36. ¡¾2¡¿B 38. ¡¾2¡¿B 40. ¡¾2¡¿B

28. ¡¾1¡¿D 32. ¡¾1¡¿B 34. ¡¾2¡¿C 36. ¡¾3¡¿A 38. ¡¾3¡¿A 40. ¡¾3¡¿D

28. ¡¾2¡¿ C 32. ¡¾2¡¿ A 35. ¡¾1¡¿ C 37. ¡¾1¡¿ A 39. ¡¾1¡¿ C

29. ¡¾1¡¿ C 33. ¡¾1¡¿ C 35. ¡¾2¡¿ A 37. ¡¾2¡¿ B 39. ¡¾2¡¿ B

29.¡¾ 2¡¿D 33.¡¾ 2¡¿B 35.¡¾ 3¡¿B 37.¡¾ 3¡¿A 39.¡¾ 3¡¿A

40. ¡¾1¡¿C 1. 2. 3. 4. 5. 6. 7. 8.

31 15

¶þ¡¢¶Á³ÌÐòд½á¹û£º

asd af aa z67 *p1=20,*p2=10 x=10,y=20 5 4 3 2 61 6,15 8

1

Èý¡¢Ìî¿ÕÌâ

1 £®¡¾ 1 ¡¿ return t 2 £®¡¾ 2 ¡¿ r!=0 3 £®¡¾ 3 ¡¿ *s == ,\\0?

¡¾ 4 ¡¿ *s-*t 4£®¡¾ 5¡¿ !=

¡¾ 6 ¡¿ j

ËÄ¡¢±à³ÌÌâ

1.

#include long fun(int x) { long y=1;

while(x>0) { y*=x; x--; } return(y); } main() { int m,n,k;

printf(\ scanf(\ printf(\ }

2 £®

#include #define N 10

float average(float array[])

{ int i=0; float s=0; for(i=0;i

s+=array[i];

s=s/N; return s;

} main()

{ float score[N],i; float ave;

printf(\for(i=0;i

scanf(\ ave=average(score);

printf(\ }

3.

#include int divisor(int a,int b) {int r; while((r=a%b)!=0)

{ a=b;

ÁªÏµ¿Í·þ£º779662525#qq.com(#Ì滻Ϊ@) ËÕICP±¸20003344ºÅ-4