 sec    584 KB    26 lines     330 bytes    2015-06-10 04:07 




?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
#include <stdio.h>
 
int main(void)
{
    int n;
    int i,j,num;
     
    while(scanf("%d",&n)&&n!=0){
        num=0;
        for(i=1;i*i<n;i++){
            if(n%i==0) num=num+i+n/i;
        }
        num-=n;
        if(num==n){
            printf("perfect number\n");
        }
        else if(num>n){
            printf("abundant number\n");
        }
        else {
            printf("deficient number\n");
        }
    }
    return 0 ;
}
 