#include
int fact(int n)
{
if(n <= 1)
return 1;
return fact(n-1)*n;
}
int main()
{
int i;
int n;
float sum = 0.0;
scanf("%d", &n);
for(i = 1; i <= n; ++i)
{
sum += 1.0f/fact(i);
}
printf("%f\n", sum);
return 0;
}
float fact(n)
float fact(int n)
{
if(n <= 0)
{
return 0;
}
float sum = 0;
int factnum = 1;
for(int i = 1; i <= n; i++)
{
factnum *= i;
sum = sum + 1/factnum;
}
return sum;
}
double fact(int n){
int t=1,i;
double sum=0;
for(i=1;i<=n;i++){
t*=i;
sum+=1/t;
}
return sum;
}
double approxE(int n){
int i;
double e=0;
for(i=0;i
return e;
}