Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:高精度除法+高精度加法

Posted by huangguandxf at 2010-08-27 22:26:53 on Problem 1517
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator