| ||||||||||
| 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 | |||||||||
可以运行的代码#include<iostream>
using namespace std;
int main()
{
double sum=0.0,num=0.0;
int i=2;
while(cin>>num)
{
if(num == 0.00)
break;
else{
sum=0.0;
i=2;
while(sum<=num)
{
sum+=1.0/i;
i++;
}
cout<<(i-2)<<" "<<"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