| ||||||||||
| 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 | |||||||||
help!!!wa了一天了!!!1517题#include<iostream.h>
#include<iomanip.h>
#include<math.h>
double a(int n)
{
double m=1.00;
double j=1.00;
for(int i=1;i<=n;i++)
{ j*=i;
m+=1/j;
}
return m;
}
void main()
{
cout<<"n e"<<endl<<"- -----------"<<endl;
for(int i=0;i<=9;i++)
cout<<i<<" "<<setprecision(10)<<a(i)<<endl;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator