#include<stdio.h>
int main()
{
int fac(int i);
int i,x;
float result=1.0;
printf("Input an integer:");
scanf("%d",x);
for(i=1;i<=30;i++){
result+=x/fac(i);
x*=x;
}
printf("the answer is:%f\n",result);
}
int fac(int i)
{
static int f=1;
f=f*i;
return(f);
}
求修改
int main()
{
int fac(int i);
int i,x;
float result=1.0;
printf("Input an integer:");
scanf("%d",x);
for(i=1;i<=30;i++){
result+=x/fac(i);
x*=x;
}
printf("the answer is:%f\n",result);
}
int fac(int i)
{
static int f=1;
f=f*i;
return(f);
}
求修改