/* Note:Your choice is C IDE */#include "stdio.h"void main(){ float fac(int i); int i,n;float s=0;//未定义 scanf("%d",&n); for(i=1;i<=n;i++)//从1开始 s+=fac(i); printf("%f",s); }float fac(i){ float c=1; if(i==1||i==0) return 1; else c=fac(i-1)*i; return 1/c;}
添加回答
举报
0/150
提交
取消