#include "stdio.h"
void main()
{
float e=1.0,t=1.0;
int n=1;
while(1/t>(1e-6)) //(1/n!)<(1e-6)是结束,你书写有错,i应是1
{
t=t*n; //得到 n!
e=e+1/t; //累加(1/n!),即计算此行前 e = 1+(1/1!)+(1/2!)+....+(1/(n-1)!)再加上(1/n!)
n++; //n : 2 3 4 ...
}
printf("e=%8.6f\n",e);
}