http://acm.hit.edu.cn/hoj/problem/view?id=1637
#include <stdio.h>
#include <math.h>
int fun(double c);
int main()
{
double c;
while (scanf("%lf", &c) && c)
{
printf("%d card(s)\n", fun(c));
}
return 0;
}
int fun(double c)
{
int i;
double s;
s = 0;
for (i = 2;;i++)
{
s += pow(i, -1.0);
if(s >= c)
break;
}
return i - 1;
}