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 "iostream" using namespace std; long jiechen(int n) { if (n==0) return 1; else if (n==1) return 1; else return n*jiechen(n-1); } int main(void) { int i; double sum=0; cout<<"n e\n- -----------\n"; for (i=0;i<10;i++) { sum += 1.0/jiechen(i); cout<<i<<' '; if (i<3) printf("%.9g\n",sum); else printf("%.9lf\n",sum); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator