Poj Solution 3372

http://poj.org/problem?id=3372

//* @author: 82638882@163.com<br />
/*��Ŀ���⣺��n��ͬѧ���һ��Բ��һ��ʦ���ǹ��4η����1��2��4��7...��ͬѧ�����Ƿ�ÿ��ͬѧ���ܵõ�����һ���ǡ�
 *����д�����صij������1~100�������ѷ��֣�ֻ�е�n=2^k��kΪ����ʱ�����YES��
 */

import java.util.Scanner;
public class Main
{
 public static void main(String[] args)
 {
    Scanner in=new Scanner(System.in);
    
    while(in.hasNext())
    {
        int a=in.nextInt();
        while(a%2==0)
            a=a/2;
        if(a==1) System.out.println("YES");
        else System.out.println("NO");
    }
  }
}
											
This entry was posted in poj. Bookmark the permalink.