您的位置:首页 > 编程语言 > Go语言

poj.org pro 1003 hangover

2013-07-15 19:38 429 查看
/*poj.org pro 1003 hangover

author: bubble

date: 2013-7-15

*/

#include<stdio.h>
int main(){
double sum;
int n;
double len;
while(scanf("%lf",&sum)!=EOF&&sum!=0.00){
n=1;
len=0.00;
do{
len+=1.0/(n+1);
n++;
}while(len<sum);
printf("%d card(s)\n",n-1);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: