Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

用计算器算的,有了上面的方法,确实水呀~~

Posted by highspeed at 2009-12-18 21:53:44 on Problem 3372
#include<iostream>


using namespace std;

int main()
{
	int a[]={1,2,4,8,16,32,64,128,256,
          512,1024,2048,4096,8192,
          16384,32768,65536,131072,
          262144,524288,1048576,
          2097152,4194304,8388608,
          16777216,33554432,67108864,
          134217728,268435456,
          536870912},n;
	while(scanf("%d",&n)!=EOF)
	{
		int flag=0;
		for(int i=0;i<30;i++)
			if(n==a[i])
				flag=1;
		if(flag)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator