#include#include
double N_I(double n)
{
double ret= 1;
while(n)
{
ret*= n;
n--;
}
return ret;
}
void main()
{
double e= 2;
double n= 1, re;
do
{
n++;
re= 1/(N_I(n));
e+= re;
} while(re > 0.00001);
printf("%.10fn", e);}
#include#include
double N_I(double n)
{
double ret= 1;
while(n)
{
ret*= n;
n--;
}
return ret;
}
void main()
{
double e= 2;
double n= 1, re;
do
{
n++;
re= 1/(N_I(n));
e+= re;
} while(re > 0.00001);
printf("%.10fn", e);}