Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main()
- {
- int n;
- int numero1=0,aux1=0,aux2=0;
- bool yes=false;
- int numero2=n;
- while(1)
- {
- cin>>n;
- if(cin.eof())
- break;
- numero1=0,numero2=n,aux1=0,aux2=0;
- yes=false;
- while(numero1!=n && n>0)
- {
- numero1++;
- numero2--;
- aux1=sqrt(numero1);
- aux2=sqrt(numero2);
- if((aux1*aux1)==numero1 && (aux2*aux2)==numero2)
- {
- cout<<"YES"<<endl;
- yes=true;
- break;
- }
- }
- if(yes==false || n<0)
- cout<<"NO"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement