hdu 1056 HangOver 水题

HangOver

    

       很水的一道题,无论是时间空间都约等于没有要求,直接模拟就可以过了。

/*
author:jxy
lang:C/C++
university:China,Xidian University
**If you need to reprint,please indicate the source**
*/
#include <cstdio>
int main()
{
    double aim,now;
    int i;
    while(~scanf("%lf",&aim)&&aim)
    {
        for(i=2,now=0;now<aim;now+=1.0/i,i++);
        printf("%d card(s)\n",i-2);
    }
}


 

上一篇:uva 10603 - Fill bfs


下一篇:hdu 1057 A New Growth Industry