求助
查看原帖
求助
505513
_557_楼主2022/4/8 22:25
#include<bits/stdc++.h>
using namespace std ;
long long tot (long long x )
{
   long long nn =0;
   double b=sqrt(x) ;
   for(long long  i=2;i<=b;++i)
   {
   	if (x%i==0)
   	{
   		if(i*i==x)
   		{
   			nn+=i ;
   		}
   		else
   		nn+=(i+x/i) ;
   	}
   }
   nn+=1 ;
   return nn ;
}
int main (void)
{
   ios::sync_with_stdio(false) ;
   
   long long num ;
   cin >> num ;
   long long n;
   n=tot(num) ;
   if(num==1){cout<<"Deficient";return 0;}
   if(n<num)  cout << "Deficient"<<"\n" ;
   if(n==num) cout << "Perfect"  <<"\n" ;
   if(n>num)  cout << "Abundant" <<"\n" ;
   return 0 ;
}
2022/4/8 22:25
加载中...