#include<iostream>
#include<stdio.h>
using namespace std ;
int main()
{
long int test ;
int x=0 ;
while(cin>>test)
{
if(test==0)
break ;
if(x!=1)
printf("PERFECTION OUTPUT\n");
x=1;
int a=0 ;
for(int i=1 ; i<=test/2 ; i++)
{
if(test%i==0)
a =a+i ;
}
if(a==test)
printf("%5d PERFECT\n",test) ;
else if(a<test)
printf("%5d DEFICIENT\n",test) ;
else if(a>test)
printf("%5d ABUNDANT\n",test) ;
}
printf("END OF OUTPUT\n") ;
return 0 ;
}
#include<stdio.h>
using namespace std ;
int main()
{
long int test ;
int x=0 ;
while(cin>>test)
{
if(test==0)
break ;
if(x!=1)
printf("PERFECTION OUTPUT\n");
x=1;
int a=0 ;
for(int i=1 ; i<=test/2 ; i++)
{
if(test%i==0)
a =a+i ;
}
if(a==test)
printf("%5d PERFECT\n",test) ;
else if(a<test)
printf("%5d DEFICIENT\n",test) ;
else if(a>test)
printf("%5d ABUNDANT\n",test) ;
}
printf("END OF OUTPUT\n") ;
return 0 ;
}
No comments:
Post a Comment