Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdio>
- using namespace std;
- int main(){
- int t; scanf("%d", &t);
- while(t--){
- long long int n, sum = 1, i;
- scanf("%lld", &n);
- for(i = 2; i*i <= n; i++){
- if(!(n % i)) sum = sum + i + n/i;
- }
- if(sum == n) printf("1\n");
- else printf("0\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement