Advertisement
sazid_iiuc

Untitled

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