Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- int main()
- {
- int n;
- while(scanf("%d", &n) != EOF)
- {
- bool pode = false;
- for(int i = 1; i * i <= n; i++)
- {
- for(int j = 1; j * j + i * i <= n; j++)
- if(j * j + i * i == n)
- {
- pode = true;
- break;
- }
- if(pode)
- break;
- }
- printf("%s\n", pode ? "YES" : "NO");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment