Tanky WooRSS

HDOJ 1289 Hat’s IEEE

16 Aug 2010
这篇博客是从旧博客 WordPress 迁移过来,内容可能存在转换异常。

题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1289


水题~~~

#include
#include
int main()
{
    long t,x;
    float N;    //注意定义成float
    while(scanf("%f",&N;)!=EOF)
    {
        t=(long)N,x=0;
        if(t<0)
            t=-t;
        while(t>1)
        {
            t/=2;
            x++;
        }
        printf("%ld %.6f\n",x,N/(2<<(x-1)));
    }
    return 0;
}