AC

 •  18天前


#include <bits/stdc++.h>
using namespace std;
long long n,t=0,x;

int main()
{
	cin>>x;
	long long tot=0,ws=0;
	n=x;
	for(long long i=1;i*i<=x;i++)
	{
		if(x%i==0)
		{
			if(i*i==x)
			{
				tot+=i; 
			}
			else
			{
				if(x/i!=n)
					tot+=i+x/i;
				else
					tot+=i;
			}
		}
	}
	if(tot==n)
	{
		cout<<"Perfect";
	}
	else if(tot>n)
	{
		cout<<"Abundant";
	}
	else
	{
		cout<<"Deficient";
	}
	return 0;
} 

评论:

请先登录,才能进行评论