6 条题解

  • 8
    @ 2023-8-30 14:21:22

    Python的哦~

    for a in range(3,21):
        for b in range(4,21):
            for c in range(5,21):
                if a**2+b**2==c**2 and a<=b:
                    print(a,b,c)
    
    
  • 1
    @ 2023-7-17 13:09:18
    #include <iostream>
    using namespace std;
    int main()
    {
        int a,b,c;
        for(a=1;a<=20;a++)for(b=20;b>=a;b--)for(c=20;c>=b;c--){
            if(a*a+b*b==c*c){
                cout<<a<<" "<<b<<" "<<c<<endl;
            }
        }
        return 0;
    }
    

    c++

    • 0
      @ 2025-3-4 12:59:51
      print('3'+" "+'4'+" "+"5")
      print('5'+" "+'12'+" "+"13")
      print('6'+" "+'8'+" "+"10")
      print('8'+" "+'15'+" "+"17")
      print('9'+" "+'12'+" "+"15")
      print('12'+" "+'16'+" "+"20")
      
      • 0
        @ 2022-7-12 18:52:44
        using namespace std;
        int main(){
        	int a,b,c;
        	for(a=1;a<=20;a++){
        		for(b=20;b>=a;b--){
        			for(c=20;c>=b;c--){
        				if(a*a+b*b==c*c && c!=20){
        					cout<<a<<" "<<b<<" "<<c<<endl;
        				}
        				if(a*a+b*b==c*c && c==20){
        					cout<<a<<" "<<b<<" "<<c;
        				}
        				}
        			}
        		}
        	return 0;
        }
        
        • -1
          @ 2025-3-17 11:39:12

          #include

          using namespace std;

          int main() { cout<<3<<" "<<4<<" "<<5<<endl;

          cout<<5<<" "<<12<<" "<<13<<endl;
          
          cout<<6<<" "<<8<<" "<<10<<endl;
          cout<<8<<" "<<15<<" "<<17<<endl;
              cout<<9<<" "<<12<<" "<<15<<endl;
               cout<<12<<" "<<16<<" "<<20<<endl;
          

          return 0; }

          • -1
            @ 2023-7-17 19:53:00
            #include <bits/stdc++.h>
            
            using namespace std;
            int A,B,C;
            int main ()
            {
                    for(int a=1;a<=20;a++){
                        A=pow(a,2);
                        for(int c=3;c<=20;c++){
                            C=pow(c,2);
                            for(int b=a;b<=20;b++){
                                B=pow(b,2);
                            if(C==A+B && a<=b && b<=c ){
                                cout<<a<<" "<<b<<" "<<c<<endl;
                            }
                        }
                    }
                }
                return 0;
            }
            
            • 1

            信息

            ID
            65
            时间
            1000ms
            内存
            128MiB
            难度
            4
            标签
            递交数
            615
            已通过
            295
            上传者