#include
#include
void main()
{
double term=1.0,e=1.0,eps=1e-05;
int i=0;
printf("input eps 1e-05:n");
scanf("%lf",&eps);
while (1){
i++;
term=term / (double) i;
e = e+term;
if (term < eps) break;
}
printf("e=%lf",e);
}
#include
#include
void main()
{
double term=1.0,e=1.0,eps=1e-05;
int i=0;
printf("input eps 1e-05:n");
scanf("%lf",&eps);
while (1){
i++;
term=term / (double) i;
e = e+term;
if (term < eps) break;
}
printf("e=%lf",e);
}