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:94queen at 2014-04-06 09:44:08 > #include <iostream> > using namespace std; > int main() > { > int n; > float c,sum=0.00; > cin>>c; > while(c!=0.00) > { > for(n=1;sum<=c;n++) > { > sum+=1.0/(n+1); > } > cout<<n-1<<" card(s)"<<endl; > cin>>c; > sum=0; > } > return 0; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator