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:Ontheline at 2008-07-10 11:23:25 > 这个题目实在太简单了,可是小问题还是有的,首先我记得C++里面有控制小数点精度的流操作符,或者是函数 > 如下: > 1 cout.precison(n) > 2 cout << setprecison(n) > 两种方法都可以,可是直接用就是科学记数法显示, > 后来查了c++ primer才知道必须这样写: > cout << '$' << fixed << setprecision(2) << average; > 这样就好了.呵呵希望能给大家帮助! Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator