View Code of Problem 20

#include<iostream>
#include<cmath>
using namespace std;

int main(void)
{
  int n;
  double cifang;
  while(cin>>n)
  {
    cifang=log(n)/log(2); 
    if(cifang==int(cifang))
      cout<<"Yes"<<endl;
    else
    {
      cifang=log(n-3)/log(2); 
      if(cifang==int(cifang))
        cout<<"Yes"<<endl;
      else
        cout<<"No"<<endl;
    }
  }
}

Double click to view unformatted code.


Back to problem 20