Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. int main()
  5. {
  6. int n;
  7. int numero1=0,aux1=0,aux2=0;
  8. bool yes=false;
  9. int numero2=n;
  10. while(1)
  11. {
  12. cin>>n;
  13. if(cin.eof())
  14. break;
  15. numero1=0,numero2=n,aux1=0,aux2=0;
  16. yes=false;
  17. while(numero1!=n && n>0)
  18. {
  19. numero1++;
  20. numero2--;
  21. aux1=sqrt(numero1);
  22. aux2=sqrt(numero2);
  23. if((aux1*aux1)==numero1 && (aux2*aux2)==numero2)
  24. {
  25. cout<<"YES"<<endl;
  26. yes=true;
  27. break;
  28. }
  29. }
  30. if(yes==false || n<0)
  31. cout<<"NO"<<endl;
  32.  
  33. }
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement