7 条题解

  • 2
    @ 2025-3-4 13:25:50
    l,f=list(map(int,input().split())),0
    for i in l:
        for j in range(1,i):
            if i%j==0:
                f+=j
        if f==i:
            print(1,end=" ")
        else:
            print(0,end=" ")
        f=0
    
  • 1
    @ 2022-7-13 8:08:24
    using namespace std;
    int main(){
    	int a,s=0;
    	while(cin>>a){
    		for(int b=1;b<a;b++){
    			if(a%b==0){
    				s+=b;
    			}
    		}
    		if(a==s){
    			cout<<1<<" ";
    		}
    		if(a!=s){
    			cout<<0<<" ";
    		}
    		s=0;
    	}
    	return 0;
    }
    
    • 0
      @ 2025-4-14 15:08:43
      a=list(map(int,input().split()))
      test1=0
      for i in a:
          for p in range(1,i):
              if i%p==0:
                  test1+=p
          if i==test1 and i!=2:
              if i==a[len(a)-1]:
                  print(1)
              else:
                  print(1,end=" ")
          else:
              if i==a[len(a)-1]:
                  print(0)
              else:
                  print(0,end=" ")
          test1=0
      
      • 0
        @ 2023-8-12 19:58:53

        python的🚀️

        x=input().split()
        y=[]
        a=0
        b=[]
        for i in x:
            a=0
            z=[]
            i=int(i)
            c=i//2
            for ii in range(1,c+1):
                if i%ii==0:
                    z.append(ii)
            for iii in z:
                iii=int(iii)
                a=a+iii
            if a==i:
                b.append("1")
            else:
                b.append("0")
        for abc in (b):
            print(abc,end=" ")
        
        • 0
          @ 2023-7-17 20:35:04
          #include <bits/stdc++.h>
          
          using namespace std;
          double figure[5],factor,all;
          int main ()
          {
                  for(int i=0;i<=4;i++){
                      cin>>figure[i];
                  }
                  for(int a=0;a<=4;a++){
                      for(int x=1;x<figure[a];x++){
                          factor=(figure[a])/(x*1.0);
                          if(factor==int(factor)){
                              all=all+x;
                          }
                      }
                      factor=0;
                      if(all==figure[a]){
                          cout<<1<<" ";
                      }
                      else{
                          cout<<0<<" ";
                      }
                      all=0;
                  }
              return 0;
          }
          
          • 0
            @ 2023-7-17 14:39:04

            #include #include using namespace std; double e,m1=0,m2=0,m3=0,m4=0,m5=0,n=0; int main() { int a,b,c,d,e; cin>>a>>b>>c>>d>>e; for(int i=1;i<a;i++){ if(a%i0){ m1+=i; } } if(m1a){ cout<<"1"<<" "; } else{ cout<<"0"<<" "; } for(int i=1;i<b;i++){ if(b%i0){ m2+=i; } } if(m2b){ cout<<"1"<<" "; } else{ cout<<"0"<<" "; } for(int i=1;i<c;i++){ if(c%i0){ m3+=i; } } if(m3c){ cout<<"1"<<" "; } else{ cout<<"0"<<" "; } for(int i=1;i<d;i++){ if(d%i0){ m4+=i; } } if(m4d){ cout<<"1"<<" "; } else{ cout<<"0"<<" "; } for(int i=1;i<e;i++){ if(e%i0){ m5+=i; } } if(m5e){ cout<<"1"<<" "; } else{ cout<<"0"<<" "; } return 0; }

            • -1
              @ 2023-1-14 10:47:08

              #include <bits/stdc++.h> using namespace std;

              int main() {

              int h = 0;
              int f;
              const int N = 5;
              int y[N];
              int x[N];
              for (int a = 0; a <= 4; a++)
              {
              	x[a] = 0;
              }
              for (int a = 0; a <= 4; a++)
              {
              	cin >> f;
              	y[a] = f;
              }
              for (int a = 0; a <= 4; a++)
              {
              	for (int i = 1; i <= y[a]; i++)
              	{
              		if (y[a] % i == 0 && i != y[a])
              		{
              			h = h + i;
              		}
              	}
              	if (h == y[a])
              	{
              		x[a] = 1;
              	}
              	h = 0;
              		
              }
              for (int a = 0; a <= 4; a++)
              {
              	cout << x[a] << " ";
              }
              

              }

              • 1

              信息

              ID
              66
              时间
              1000ms
              内存
              128MiB
              难度
              5
              标签
              递交数
              796
              已通过
              293
              上传者