HDU 1056

来源:互联网 发布:mac iphone 蓝牙 网络 编辑:程序博客网 时间:2024/05/22 23:30
//水题 按题目公式来即可#include<stdio.h>int main(void){   double a,s;   int i;   while(scanf("%lf",&a)!=EOF&&a!=0)   {       s=0;       i=1;       while(s<a)       {           i++;           s=s+1.0/i;       }       printf("%d card(s)\n",i-1);   }   return 0;}

[http://acm.hdu.edu.cn/showproblem.php?pid=1056]