cÓïÑÔ±¨¸æ ÏÂÔر¾ÎÄ

½ðÁê¿Æ¼¼Ñ§ÔºÊµÑ鱨¸æ

/**********FOUND**********/

int a[2][3]={1,34,23,56,345,7};

/**********FOUND**********/ max=a[0][0]; s=t=0;

for(i=0;i<2;i++)

/**********FOUND**********/ for(j=0;j<3;j++) if(a[i][j]>max)

{ max=a[i][j]; s=i; t=j; } /**********FOUND**********/

printf(\}

3¡¢³ÌÐòÉè¼Æ

˵Ã÷£¬ËùÓÐÌâÄ¿¾ùÐèÌí¼Ómain£¨£©£¬ÔÚmain£¨£©Öе÷ÓÃ×Óº¯Êý²¢Éè¼ÆÍêÕûµÄÊäÈëÊä³ö²Å¿Éµ÷ÊÔͨ¹ý¡£ (1) ¹¦ÄÜ£º±àдº¯Êýfloat fun(int n)£¬ÇóÒ»·ÖÊýÐòÁÐ2/1£¬3/2£¬5/3£¬8/5£¬13/8£¬21/13?µÄÇ°nÏîÖ®ºÍ¡£

˵Ã÷£ºÃ¿Ò»·ÖÊýµÄ·ÖĸÊÇÇ°Á½ÏîµÄ·Öĸ֮ºÍ£¬Ã¿Ò»·ÖÊýµÄ·Ö×ÓÊÇÇ°Á½ÏîµÄ·Ö×ÓÖ®ºÍ¡£ ÀýÈ磺ÇóÇ°20ÏîÖ®ºÍµÄֵΪ32.660259¡£

(2)Íê³É×Óº¯Êýint fun(int n)£¬ÕÒ³öÒ»¸ö´óÓÚ¸ø¶¨ÕûÊýÇÒ½ôËæÕâ¸öÕûÊýµÄËØÊý£¬²¢×÷Ϊº¯ÊýÖµ·µ»Ø¡£

£¨3£©¹¦ÄÜ£º±àдº¯Êývoid fun(int n,int a[])£¬°´Ë³Ðò½«Ò»¸ö4λµÄÕýÕûÊýÿһλÉϵÄÊý×ִ浽һάÊý×飬ȻºóÔÚÖ÷º¯ÊýÊä³ö¡£ÀýÈçÊäÈë5678£¬ÔòÊä³ö½á¹ûΪ 5 6 7 8¡£

£¨4£©¹¦ÄÜ£º±àдº¯Êývoid fun(int arr[],int n)½«Ò»¸öÊý×éÖеÄÖµ°´ÄæÐò´æ·Å£¬²¢ÔÚmain()º¯ÊýÖÐÊä³ö¡£

ÀýÈ磺ԭÀ´´æ˳ÐòΪ8,6,5,4,1¡£ÒªÇó¸ÄΪ£º1,4,5,6,8¡£

(5) ¹¦ÄÜ£º³ÌÐò¶¨ÒåÁËN¡ÁNµÄ¶þάÊý×飬²¢ÔÚÖ÷º¯ÊýÖÐ×Ô¶¯¸³Öµ¡£Çë±àдº¯Êýfun(int a[][N],int n)£¬Ê¹Êý×éa×óÏÂÈý½ÇÔªËØÖеÄÖµ³ËÒÔn¡£ ÀýÈ磺ÈônµÄֵΪ3£¬aÊý×éÖеÄֵΪ

| 1 9 7 | | 3 9 7 | a = | 2 3 8 | Ôò·µ»ØÖ÷³ÌÐòºóaÊý×éÖеÄֵӦΪ | 6 9 8 | | 4 5 6 | | 12 15 18|

(6)¹¦ÄÜ£º±àдº¯Êývoid fun(int array[3][3])£¬ÊµÏÖ¾ØÕó£¨3ÐÐ3ÁУ©µÄתÖ㨼´ÐÐÁл¥»»£©¡£

ÀýÈ磺ÊäÈëÏÂÃæµÄ¾ØÕó£º 100 200 300 400 500 600 700 800 900 ³ÌÐòÊä³ö£º

100 400 700 200 500 800

11

½ðÁê¿Æ¼¼Ñ§ÔºÊµÑ鱨¸æ

300 600 900

4¡¢ÌÖÂÛ¡¢Ë¼¿¼Ìâ £¨1£©¹¦ÄÜ£º±àдº¯Êýfloat fun()£¬ÀûÓÃÒÔ¼òµ¥µü´ú·½·¨Xn+1=cos(Xn)Ç󷽳̣ºcos(x)-x=0µÄÒ»¸öʵ¸ù¡£µü´ú²½ÖèÈçÏ£º

1£©È¡x1³õֵΪ0.0£»

2£©x0=x1£¬°Ñx1µÄÖµ¸³¸øx0£»

3£©x1=cos(x0)£¬Çó³öÒ»¸öеÄx1£»

4£©Èôx0-x1µÄ¾ø¶ÔֵСÓÚ0.000001£¬Ö´Ðв½Ö裨5£©£¬·ñÔòÖ´Ðв½Ö裨2£©£» 5£©ËùÇóx1¾ÍÊÇ·½³Ìcos(x)-x=0µÄÒ»¸öʵ¸ù£¬×÷Ϊº¯ÊýÖµ·µ»Ø¡£ Êä³ö£º³ÌÐò½«Êä³ö½á¹ûRoot=0.739085¡£

£¨2£©¹¦ÄÜ£º±àдfloat fun(float array[],int n)£¬Í³¼Æ³öÈô¸É¸öѧÉúµÄƽ¾ù³É¼¨£¬×î¸ß·ÖÒÔ¼°µÃ×î¸ß·ÖµÄÈËÊý¡£

ÀýÈ磺ÊäÈë10ÃûѧÉúµÄ³É¼¨·Ö±ðΪ92£¬87£¬68£¬56£¬92£¬84£¬67£¬75£¬92£¬66£¬ÔòÊä³öƽ¾ù³É¼¨Îª77.9£¬×î¸ß·ÖΪ92£¬µÃ×î¸ß·ÖµÄÈËÊýΪ3ÈË¡£

£¨3£©±àдº¯Êý int fun(int lim,int aa[MAX])£¬¸Ãº¯ÊýµÄ¹¦ÄÜÊÇÇó³öСÓÚlimµÄËùÓÐËØÊý²¢·ÅÔÚaaÊý×éÖУ¬¸Ãº¯Êý·µ»ØÇó³öËØÊýµÄ¸öÊý¡£

£¨4£©¹¦ÄÜ£º±àдº¯Êýint fun(int a[M][M])£¬Çó5ÐÐ5ÁоØÕóµÄÖ÷¡¢¸±¶Ô½ÇÏßÉÏÔªËØÖ®ºÍ¡£×¢Ò⣬Á½Ìõ¶Ô½ÇÏßÏཻµÄÔªËØÖ»¼ÓÒ»´Î¡£

£¨5£©¹¦ÄÜ£ºÇë±àÒ»¸öº¯Êývoid fun(int tt[M][N],int pp[N])£¬ttÖ¸ÏòÒ»¸öMÐÐNÁеĶþάÊý×飬Çó³ö¶þάÊý×éÿÁÐÖÐ×îСԪËØ£¬²¢ÒÀ´Î·ÅÈëppËùָһάÊý×éÖС£¶þάÊý×éÖеÄÊýÒÑÔÚÖ÷º¯ÊýÖи³Óè¡£

³ÌÐòÇåµ¥¼°Á÷³Ìͼ£º

<1> #include float fun(int n); main() {

int n; float y;

scanf(\ y=fun(n);

float fun (int n); {

int i;

float f1=1,f2=1,f3,s=0; for(i=0;i<=n;i++) {

f3=f1+f2; f1=f2; f2=f3;

12

½ðÁê¿Æ¼¼Ñ§ÔºÊµÑ鱨¸æ

s=s+f2/f1; }

return s;

printf(\ } }

<2> #include

#include int fun(int n) {

int i,k;

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

for(k-2;k

return i;

} }

main() {

int m;

scanf(\

printf(\}

<3> #include

#include

void fun(int n,int a[]);

main() {

int m,a[4]={0},n,i; scanf(\ if(m<10000) {

fun(m,a);

for(i=0;i<4;i++) {

printf(\

13 ½ðÁê¿Æ¼¼Ñ§ÔºÊµÑ鱨¸æ

} } }

void fun(int n,int a[]) {

int i=3; while(n!=0) {

a[i--]=n; n=n/10; } }

<4> #include

void fun(int arr[],int n) {

int i,temp;

for(i=0;i<=n/2;i++) {

temp=arr[i];

arr[i]=arr[n-1-i]; arr[n-1-i]=temp; } }

main() {

int i,n,arr[100]={8,6,5,4,1}; scanf(\ fun(arr,5);

for(i=0;i<5;i++)

printf(\}

<5> #include #define N 3

void fun(int a[][N]); void main() {

int i,j,a[N][N]; for(i=0;i

14