#include <iostream>
#include <iomanip>
using namespace std;
int main(){
cin.sync_with_stdio(0);
cout<<"PERFECTION OUTPUT"<<endl;
while(1){
int n;
cin>>n;
if(!n)
break;
int sum=0;
for(int i=1;i<=n/2;i++)
if(n%i==0)
sum+=i;
cout<<setw(5)<<right<<n<<" ";
if(sum==n)
cout<<"PERFECT"<<endl;
else if(sum<n)
cout<<"DEFICIENT"<<endl;
else
cout<<"ABUNDANT"<<endl;
}
cout<<"END OF OUTPUT"<<endl;
}
#include <iomanip>
using namespace std;
int main(){
cin.sync_with_stdio(0);
cout<<"PERFECTION OUTPUT"<<endl;
while(1){
int n;
cin>>n;
if(!n)
break;
int sum=0;
for(int i=1;i<=n/2;i++)
if(n%i==0)
sum+=i;
cout<<setw(5)<<right<<n<<" ";
if(sum==n)
cout<<"PERFECT"<<endl;
else if(sum<n)
cout<<"DEFICIENT"<<endl;
else
cout<<"ABUNDANT"<<endl;
}
cout<<"END OF OUTPUT"<<endl;
}
Comments
Post a Comment