AC

❤ · 发布于 2025-08-20 · 浏览 240 回复 0
#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;
} 

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复