6 solutions

  • 2
    @ 2026-8-6 12:00:47

    史上最简单的方法,我们已知最小的完美数是6、28、496、8128和33550336,所以只需用条件判断的方法把它做出来就行,方法如下👇点赞的是彭于晏

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int a;
        cin>>a;
        if(a==6||a==28||a==496||a==8128||a==33550336){
        	cout<<"YES";
    	}
    	else
    	{
    		cout<<"NO";
    	}
        return 0;
    }
    
  • 0
    @ 2026-8-6 15:17:43
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int x;
    	cin>>x;
        if(x==6||x==28||x==496||x==8128||x==33550336)
    	{
    		cout<<"YES";
    	}
    	else
    	{
    		cout<<"NO";
    	}
    	return 0; 
    }
    
    • -2
      @ 2024-9-22 13:50:05
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int n;
      	cin>>n;
      	int s=1;
      	for(int i=2;i<=sqrt(n);i++)
      	{
      		if(n%i==0)
      		{
      			s+=i;
      			{
      				if(n/i!=i)
      				{
      					s+=n/i; 
      				}
      			}
      		}
      	}
      	if(n==s) cout<<"YES";
      	else cout<<"NO";
      	return 0;
      }
      
      
      
      • -14
        @ 2024-9-8 11:00:38

        sha bi

        • -14
          @ 2024-7-4 11:18:02

          zsdsfkeiohoitq24ioerjhop

          • -14
            @ 2024-4-10 20:16:32

            别看了自己写;

          • 1

          Information

          ID
          31
          Time
          1000ms
          Memory
          256MiB
          Difficulty
          3
          Tags
          (None)
          # Submissions
          388
          Accepted
          107
          Uploaded By