Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int light(int n){
- int root = sqrt(n);
- int count = 0;
- for(int i =1;i<=root;i++){
- if(n%i==0){
- int div = n/i;
- if(div ==i){
- count += 1;
- }
- else{
- count += 2;
- }
- }
- }
- if(count%2==0)
- return 0;
- else
- return 1;
- }
- int main(){
- long long n;
- while(1){
- cin >> n;
- if(n==0)
- break;
- else{
- int checker = light(n);
- if(checker==0)
- cout << "no" << '\n';
- else
- cout << "yes" << '\n';
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment