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:求助:为什么e必须是double类型?setprecision(10)才通过,9就不对,为什么啊?

Posted by hujinyong199 at 2007-12-11 22:26:46 on Problem 1517
In Reply To:Re:求助:为什么e必须是double类型?setprecision(10)才通过,9就不对,为什么啊? Posted by:tkchenhetian at 2007-11-24 21:44:34
> >e的有效位(包括整数的2)一共有10位,就得setprecision(10);呵呵~~
#include<iostream>
using namespace std;
void main(){
	cout<<"n e\n"
	    <<"- -----------\n"
        <<"0 1\n"
        <<"1 2\n"
        <<"2 2.5\n"
        <<"3 2.666666667\n"
        <<"4 2.708333333\n"
		<<"5 2.716666666\n"
		<<"6 2.718055555\n"
		<<"7 2.718253968\n"
		<<"8 2.718278770\n"
		<<"9 2.718281526"<<endl;
}



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