本题传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1056
英文阅读理解题,六级难度。
#include<stdio.h>
#include<string.h>
//#define LOCAL
using namespace std;
int main(){
#ifdef LOCAL
freopen("input.txt","r",stdin);
#endif // LOCAL
double input=0;
while(scanf("%lf",&input)!=EOF && input!=0.00){
double sum=0;
double i=2.0;
int count=0;
while(sum<input){
sum+=1.0/i++;
count++;
}
printf("%d card(s)\n",count);
}
return 0;
}