1、功能:用辗转相除法求两个整数的最大公约数。int gcd(int n,int m)/*Program*/int temp,c;if(m#includevoid wwjt(); void sort(int a,int n)/*Program*/int min,k,i,j,temp;for(i=0;ivoid wwjt(); long sum(long f1,long f2)/*Program*/int i,f3,fsum;/scanf(“%d“,/if(n=1) return 1;/else if(n=2) return 2;/else/ fsum=2;for(i=3;ivoid wwjt();
2、 float sum(int n)/*Program*/int i,j;float jc,sjc=0;for(i=3;ivoid wwjt(); float fun(int n)/*Program*/int i;float fsum,fz1=2,fz2=3,fm1=1,fm2=2,fz3,fm3;fsum=fz1/fm1+fz2/fm2;if(n=1) return fz1/fm1;else if(n=2) return fsum;else for(i=3;ivoid wwjt(); main()float fun();printf(“无理数 e 的值是:%fn“,fun();wwjt();float fun()/*Program*/int i,j;float fsum=0,jc=1;for(i=1;1/jc=0.000001;i+)fsum+=1/jc;jc=1;for(j=1;j#define M 5void wwjt();int fun(int aMM)/*Program*/int sum=0,i,j;for(i=0;i#includevoid wwjt(); void sort(int a,int n)/*Program*/int i,j,temp;for(i=1;in;i+)