6 solutions

  • 1
    @ 2026-7-21 15:04:13

    正解

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	for(int i=2;i<=n;i++)
    	{
    		if(i==6||i==28||i==496||i==8128)
    		{
    			cout<<i<<endl;
    		}
    	}
        return 0;
    }
    
    • 1
      @ 2026-7-21 15:03:11

      正解

       #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int n;
          cin>>n;
          if(n>5)
          {
              cout<<6<<endl;
          }
          if(n>27)
          {
              cout<<28<<endl;
          }
          if(n>495)
          {
              cout<<496<<endl;
          }
          if(n>8127)
          {
              cout<<8128<<endl;
          }
          return 0; 
      }
      
      • 1
        @ 2026-7-21 13:46:15

        @所有人

        • 1
          @ 2026-7-21 13:42:43

          正解

          #include<bits/stdc++.h>
          using namespace std;
          bool w(int n)
          {
          	int t=n,s=1;
          	for(int i=2;i<=sqrt(n);i++)
          	{
          		if(n%i==0)
          		{
          			s+=i;
          			if(n/i!=i)
          			{
          			    s=s+n/i; 
          			}
          		}
          	}
          	if(t==s)return 1;
          	else return 0;
          }
          int main()
          {
          	int n;
          	cin>>n;
          	for(int i=2;i<=n;i++)
          	{
          		if(w(i))
          		{
          			cout<<i<<endl;
          		}
          		
          	}
              return 0;
          }
          
          
          • 1
            @ 2025-11-17 19:14:41
            #include<bits/stdc++.h>
            using namespace std;
            bool w(int n)
            {
            	int t=n,s=1;
            	for(int i=2;i<=sqrt(n);i++)
            	{
            		if(n%i==0)
            		{
            			s+=i;
            			if(n/i!=i)
            			{
            					s=s+n/i; 
            			}
            		}
            	}
            	if(t==s)return 1;
            	else return 0;
            }
            int main()
            {
            	int n;
            	cin>>n;
            	for(int i=2;i<=n;i++)
            	{
            		if(w(i))
            		{
            			cout<<i<<endl;
            		}
            		
            	}
                return 0;
            }
            
            • 1
              @ 2024-8-20 16:04:00
              #inlude<bits/stdc++.h>
              using namespace std;
              bool w(int n)
              {
              	int t=n,s=1;
              	for(int i=2;i<=sqrt(n);i++)
              	{
              		if(n%i==0)
              		{
              			s+=i;
              			if(n/i!=i)
              			{
              					s=s+n/i; 
              			}
              		}
              	}
              	if(t==s)return 1;
              	else return 0;
              }
              int main()
              {
              	int n;
              	cin>>n;
              	for(int i=2;i<=n;i++)
              	{
              		if(w(i))
              		{
              			cout<<i<<endl;
              		}
              		
              	}
              }
              
              ****
              
              
              • 1

              Information

              ID
              930
              Time
              1000ms
              Memory
              256MiB
              Difficulty
              1
              Tags
              (None)
              # Submissions
              92
              Accepted
              30
              Uploaded By