e=1+1/1!+2/2!+3/3!+。。。。`
# include <stdio.h>
# include <stdlib.h>
double jie(int a)
{
int i;
double b = 1.0;
for (i = 1;i <= a;i++)
{
b = b * i;
}
return b;
}
int main()
{
double e = 1.0,a=1.0;
int i;
for (i=1;a>0.000001||a<-0.000001;i++)
{
a = 1 / jie(i);
e = e + 1 / jie(i);
}
printf("%f", e);
system("pause");
return 0;
}