2017年9月10日

编写函数fun,其功能是计算并输出如下多项式的值,sn=1+1/2!+1/3!+...+1/n!,例如,主函数从键盘输入15,输出的值是1.718282

摘要: #include double fun(int n) { double sn=0.0,t; int i,j; for(i=0;i<=n;i++){ t=1.0; for(j=0;j<=i;j++) t=t*j; sn=sn+t; } return sn; } 阅读全文

posted @ 2017-09-10 17:04 jun俊 阅读(2771) 评论(0) 推荐(0)

导航