#include<stdio.h>
int main()
{
long long i , j, x, sum=0;
printf("PERFECTION OUTPUT\n");
while(scanf("%lld",&x)==1){
if(x==0)
break;
else{
for(i=1; i<x; ++i){
if(x%i==0)
sum+=i;
}
if(sum==x)
printf("%5lld PERFECT\n",x);
else if(sum<x)
printf("%5lld DEFICIENT\n",x);
else if(sum>x)
printf("%5lld ABUNDANT\n",x);
}
sum=0;
}
printf("END OF OUTPUT\n");
return 0;
}
int main()
{
long long i , j, x, sum=0;
printf("PERFECTION OUTPUT\n");
while(scanf("%lld",&x)==1){
if(x==0)
break;
else{
for(i=1; i<x; ++i){
if(x%i==0)
sum+=i;
}
if(sum==x)
printf("%5lld PERFECT\n",x);
else if(sum<x)
printf("%5lld DEFICIENT\n",x);
else if(sum>x)
printf("%5lld ABUNDANT\n",x);
}
sum=0;
}
printf("END OF OUTPUT\n");
return 0;
}
No comments:
Post a Comment