Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifdef _MSC_VER
- #define _CRT_SECURE_NO_WARNINGS 1
- #endif
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- unsigned int n; // unsigned since n <= (2^32)-1
- while (scanf("%d", &n) != EOF)
- {
- if (n == 0) break;
- unsigned int root = sqrt(n);
- if (root*root == n) // Is it a perfect square?
- cout << "yes\n";
- else
- cout << "no\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement