HDU 1056 HangOver
水题~
int cmp(double a,double b)
{
if(fabs(a-b) < eps) return 0;
return a>b?1:-1;
}
int main()
{
double x;
while(~scanf("%lf",&x))
{
if(!cmp(x,0)) break;
double res=0;
int cnt=0;
int d=2;
while(true)
{
if(cmp(res,x)>=0) break;
++cnt;
res+=1.0/d++;
}
printf("%d card(s)\n",cnt);
}
//system("pause");
}