8 条题解

  • 2
    @ 2024-8-29 16:46:18

    #include<bits/stdc++.h> using namespace std; int main(){ int n; scanf("%d",&n); for(int i=1;i<=n;i++){ int sum=0; for(int j=1;j<i;j++){ if(i%j0){ sum+=j; } } if(sumi){ printf("%d its factors are ",i); for(int q=1;q<i;q++){ if(i%q==0){ printf("%d ",q); } } printf("\n"); } } return 0; }

    • 2
      @ 2024-8-4 19:53:20
      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	int n,i,j,sum;
      	scanf("%d",&n);
      	for(i=1;i<=n;i++){
      		sum=0;
      		for(j=1;j<i;j++){
      			if(i%j==0){
      				sum+=j;
      			}
      		}
      		if(sum==i){
      			printf("%d its factors are ",i);
      			for(j=1;j<i;j++){
      				if(i%j==0){
      					printf("%d ",j);
      				}
      			}
      			printf("\n");
      		}
      	}
      	return 0;
      }
      
      • -1
        @ 2024-7-30 20:28:00
        
        ```#include<bits/stdc++.h>
        using namespace std;
        int man(){
        int a;
        cin>>a;
        if(a>=6 and a<28) cout<<"6 its factors are 1 2 3";
        if(a>=28 and a<496) cout<<"6 its factors are 1 2 3"<<endl<<"28 its factors are 1 2 4 7 14";
        if(a>=496) cout<<"6 its factors are 1 2 3"<<endl<<"28 its factors are 1 2 4 7 14"<<endl<<"496 its factors are 1 2 4 8 16 31 62 124 248";
        return 0;
        • -2
          @ 2024-7-21 14:07:58

          #include<bits/stdc++.h> using namespace std; int man(){ int a; cin>>a; if(a>=6 and a<28) cout<<"6 its factors are 1 2 3"; if(a>=28 and a<496) cout<<"6 its factors are 1 2 3"<<endl<<"28 its factors are 1 2 4 7 14"; if(a>=496) cout<<"6 its factors are 1 2 3"<<endl<<"28 its factors are 1 2 4 7 14"<<endl<<"496 its factors are 1 2 4 8 16 31 62 124 248"; return 0; }

          • -4
            @ 2024-7-18 20:19:53

            • -5
              @ 2024-7-17 13:59:56

              #include<bits/stdc++.h>

              using namespace std;

              int maIn(){

              int m,a,n;

              cin>>m;

              for(int i=5;i<=a;i++){

              if(a%i==0){a+=i};

              }

              if(i==a){

              cout<<a<<"its factors are";

              for(i=1;i<=a/2;i++){

              if(a%i==0){cout<<i;}

              }}

              return 0;

              }

              • -6
                @ 2024-7-18 20:19:23

                • -7
                  @ 2024-7-17 14:07:12

                  #include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,x,y,sum=0; cin>>a>>b>>c; for(x=0;x<=c/a;x++){ y=(c-ax)/b; if(ax+b*y==c)sum++; } cout<<sum<<endl; return 0; } 百分百过

                • 1

                信息

                ID
                963
                时间
                1000ms
                内存
                64MiB
                难度
                7
                标签
                递交数
                148
                已通过
                39
                上传者