5.26

#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);}

posted @ 2023-05-26 08:31  孙锺鸣  阅读(4)  评论(0编辑  收藏  举报