| ||||||||||
| 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 a;
int count;
double sum;
while(cin>>a){
if(a==0)
cout<<'\n';
else{
count = 2;
sum = 0;
while((sum += (double)(1.0)/(count))<a){
count++;
}
cout<<count-1<<" 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