| ||||||||||
| 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 | |||||||||
Re:高精度除法+高精度加法In Reply To:高精度除法+高精度加法 Posted by:Magic347 at 2010-06-24 12:50:58 直接算就行了
#include<iostream>
#include<algorithm>
#include<map>
#include<stdio.h>
using namespace std;
int main()
{
int a[11];
a[0]=1;
for(int i=1;i<10;i++)a[i]=i*a[i-1];
//cout<<a[9];
double b[11]={0};
cout<<"n e"<<endl<<"- -----------"<<endl;
for(int i=0;i<10;i++){b[i]=1000000000.0/a[i]+b[i-1];}
cout<<"0 1"<<endl<<"1 2"<<endl<<"2 2.5"<<endl;
for(int i=3;i<10;i++){
printf("%d %.9lf\n",i,b[i]/1000000000.0);
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator