UVA 10110 Solution

using namespace std;
#include<iostream>
#include<cmath>
int main()
{
    long long unsigned int N,Temp;
    bool ans;
    while ( cin>>N )
    {
          if(!N)
          break;
          ans=false;
          Temp=(int)pow((float)N,0.5F);
          Temp-=2;
          for(int i=0;i<4;i++,Temp++ )
          {
               if ( Temp*Temp==N )
               {
                    ans=true;
                    break;
               }
          }
          if(ans) cout<<“yes\n”;
          else cout<<“no\n”;
    }
    return 0;
}

About these ads

Leave a comment

Filed under uva

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s