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 |
这个题Special Judged#include <iostream> #include <cmath> using namespace std; double solver(double i) { double ans=1; if(i==0) return 1; else { for(int j=1;j<=i;j++) ans*=j; } return 1.0/ans; } void main() { double sum=0; cout<<"n e"<<endl; cout<<"- -----------"<<endl; cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(9); for(double i=0;i<10;i++) { sum=0; for(double j=0;j<=i;j++) sum+=solver(j); cout<<int(i)<<" "<<sum<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator