#include<stdio.h>
int main()
{
int i, n, sum = 0,l = 1;
while(scanf("%d", &n) != EOF && n>0)
{
for(i=1; i<=n/2; i++)
{
if(n%i == 0)
{
sum = sum + i;
}
}
if(l != 0)
{
printf("PERFECTION OUTPUT\n");
}
l = 0;
if(sum == n)
{
printf("%5d PERFECT\n",n);
}
else if(sum < n)
{
printf("%5d DEFICIENT\n",n);
}
else if(sum > n)
{
printf("%5d ABUNDANT\n",n);
}
sum = 0;
}
printf("END OF OUTPUT\n");
return 0;
}
int main()
{
int i, n, sum = 0,l = 1;
while(scanf("%d", &n) != EOF && n>0)
{
for(i=1; i<=n/2; i++)
{
if(n%i == 0)
{
sum = sum + i;
}
}
if(l != 0)
{
printf("PERFECTION OUTPUT\n");
}
l = 0;
if(sum == n)
{
printf("%5d PERFECT\n",n);
}
else if(sum < n)
{
printf("%5d DEFICIENT\n",n);
}
else if(sum > n)
{
printf("%5d ABUNDANT\n",n);
}
sum = 0;
}
printf("END OF OUTPUT\n");
return 0;
}
Comments
Post a Comment