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 |
一次就AC了,0ms,这题水的#include <iostream> using namespace std; int Cards(int n,double length) { double sum=1.0/(n+1); while(sum<length)sum+=(1.0/(++n+1)); return n; } int main() { double length=0; while(cin>>length) { if(length==0.00)break; cout<<Cards(1,length)<<" 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