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:348854308 at 2010-02-02 23:17:14 #include <iostream> using namespace std; int main() { float f; while (cin>>f&&f!=0.00) { int count = 0; float fsum = 0.00f; while (fsum<f&&++count) fsum += 1.0/(count+1); cout<<count<<" card(s)"<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator