求大神指教。。。。为什么我编的程序都有一个错误
#include<stdio.h>double fun(int n)
double fun(int n)
{
int i;
double sum = 0.0;
double temp;
for(i = 1;i<=n;i++)
{
temp = i*(i+1);
sum += 1/temp;
}
return sum;
}
void main()
{double k;
k=fun(10);
printf("k=%f\n",k);
}
#include<stdio.h>
int fun( int t)
{ int f1,f2;
f1=1;f2=1;
while(f2<=t)
{f1=f1+f2;
f2=f2+f1;
}
if(i>t)return(f1);
else return(f2);
}
unsigned int Fibonacci(int n);
int main( void )
{
int i;
for(i = 1 ;i <= 20;i ++)
{
printf("%d\n",Fibonacci(i));
}
return 0;
}
unsigned int Fibonacci(int n)
{
if( n == 1 || n == 2)
return 1;
else
return Fibonacci(n-1)+Fibonacci(n-2);
}
#include<stdio.h>
double fun(double n)
{
double i,a;
a = 1;
for(i=1;i<=n;i++)a *= i;
return a;
}
void main()
{
{ int x,y,m,n,c,d;
printf("input x:\n");
scanf("%d",&x);
y=fun(x);
printf("input m:\n");
scanf("%d",&m);
m=fun(n);
d=fun(x-n);
c=y/d*m;
printf("%c\n",c);
}