摘要: //计算1!+2!+…+100!#includedouble fact(int n);int main(){ int i; double sum; sum=0; for(i=1;i<=100;i++) sum=sum+fact(i); printf("1!+2!+...+100!=%e\n",sum); return 0;}double fact(int n){ int i; double result; result=1; for(i=1;i<=n;i++) result=result*i; ret... 阅读全文
posted @ 2013-10-21 08:37 xiaobao123 阅读(128) 评论(1) 推荐(0) 编辑