Advertisement
sazid_iiuc

Untitled

May 30th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. main()
  5. {
  6.     //ifstream cin("10110.in");
  7.     //ofstream cout("10110.out");
  8.     while (true)
  9.     {
  10.         int n, count = 0;
  11.         cin >> n;
  12.  
  13.         if (n == 0)
  14.         {
  15.             break;
  16.         }
  17.         else
  18.         {
  19.             for (int i = 1; i <= sqrt(n); i++)
  20.             {
  21.                 if (n % i == 0)
  22.                 {
  23.                     count++;
  24.                 }
  25.             }
  26.  
  27.             if (count % 2 == 0)
  28.             {
  29.                 cout << "YES" << endl;
  30.             }
  31.             else
  32.             {
  33.                 cout << "NO" << endl;
  34.             }
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement