*sdnu1483.Problem_A

来源:互联网 发布:android源码下载 编辑:程序博客网 时间:2024/06/07 03:50

1483.Problem_A
Time Limit: 1000 MS Memory Limit: 32768 KB
Total Submission(s): 117 Accepted Submission(s): 29
Description
Check whether an integer n is a power of 2.
Input
First line contains a single integer T (T<=20000000) which denotes the number of test cases. For each test case, there is an big integer N (0

#include<cstdio>#include <cmath>int main(){    double b;    int i,a;    scanf("%d",&a);    for(i=0; i<a; i++)    {        scanf("%lf",&b);        while(fmod(b,2)==0)        {            if(fmod(b,2)==0)    b=b/2;            else break;        }        if(b==1) printf("Yes\n");        else printf("No\n");    }    return 0;}

本来是对的。。。又要求用Java。。。 再说吧再说吧。。。