Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 21st, 2012  |  syntax: None  |  size: 0.37 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. main()
  5. {
  6.     long long int n,i;
  7.     bool b;
  8.     while(cin>>n)
  9.     {
  10.         if(n==0)break;
  11.         b=0;
  12.         i=int(sqrt(n)-1);
  13.         for(;i<=sqrt(n);i++)
  14.             if(i*i==n)b=!b;
  15.         if(b)
  16.             cout<<"yes"<<endl;
  17.         else
  18.             cout<<"no"<<endl;
  19.     }
  20.     return 0;
  21. }