源代码!
# include<stdio.h>
main()
{ double sum=1,n;
for (n=1;jichen(n)<=10e-6;n++)
{
sum=sum+jichen(n);
}
printf("e=%lf",sum);
getch ();
}
double jichen(double n)
{
int i;
double c,s=1;
for (i=1;i<=n;i++)
s=s*i;
c=1/s;
return (c);
}