
#include<stdio.h>
main(){
double s=0,t;
int i,n,j;
printf("please input the number of n:");
scanf("%d",&n);
for(i=1;i<=n;i++){
t=1;
for(j=1;j<=i;j++)
t=t*j;
s=s+1/t;}
printf("%f",s);}
#include<stdio.h>
main(){
double s=0,t;
int i,n,j;
printf("please input the number of n:");
scanf("%d",&n);
for(i=1;i<=n;i++){
t=1;
for(j=1;j<=i;j++)
t=t*j;
s=s+1/t;}
printf("%f",s);}