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:求助:为什么e必须是double类型?setprecision(10)才通过,9就不对,为什么啊?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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator