Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这搞毛呀,大水,晒一下代码……#include<stdio.h> double fac(int n) { float f; if(n==0||n==1) f=1; else if(n>1) { f=fac(n-1)*n; } return f; } void main() { double sum=0; double a; int i; printf("n e\n"); printf("- -----------\n"); for(i=0;i<10;i++) { a = 1/fac(i); sum = a +sum; printf("%d %.9f\n",i,sum); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator