5 条题解

  • 0
    @ 2025-6-15 11:07:15

    #include<bits/stdc++.h>
    #define int long long
    using namespace std;
    int a[10005];
    signed main() 
    {
    	cin>>a[0]>>a[1]>>a[2];
    	sort(a,a+3);
    	if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])cout<<a[0]*a[1]/2.0;
    	else cout<<"no"; 
    }
    
    • 0
      @ 2024-12-28 15:45:13

      又是重题。awa...

      #include<bits/stdc++.h>
      #define int long long
      #define INF 0x3f3f3f
      using namespace std;
      int a[5];
      signed main(){
      	cin>>a[1]>>a[2]>>a[3];
      	sort(a+1,a+4);
      	if(a[1]*a[1]+a[2]*a[2]==a[3]*a[3])
      		cout<<a[1]*a[2]/2;
      	else cout<<"no";
      	return 0;
      }
      
      • 0
        @ 2024-12-28 12:04:38

        双倍经验

        #include<bits/stdc++.h>
        using namespace std;
        signed main(){
        	int a[4];
        	cin>>a[1]>>a[2]>>a[3];
        	sort(a+1,a+4);
        	if(a[1]*a[1]+a[2]*a[2]!=a[3]*a[3])cout<<"no";//勾股定理
        	else cout<<a[1]*a[2]/2;
        }
        
        • 0
          @ 2024-12-24 21:30:24

          呃呃呃怎么这么多重掉的题:

          #include<bits/stdc++.h>
          using namespace std;
          int main()
          {
          	int a[3];
          	cin>>a[0]>>a[1]>>a[2];
          	sort(a,a+3);
          	if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])
          	{
          		cout<<a[0]*a[1]/2;
          	}
          	else
          	{
          		cout<<"no";
          	}
          	return 0;
          }
          
          • 0
            @ 2024-12-22 11:03:54

            C++ :

            #include<bits/stdc++.h>
            using namespace std;
            int main(){
                int a,b,c;
                cin>>a>>b>>c;
                if(a*a+b*b==c*c)
                cout<<a*b/2;
                else if(a*a+c*c==b*b)
                cout<<a*c/2;
                else if(c*c+b*b==a*a)
                cout<<b*c/2;
                else cout<<"no";
                return 0;
            } 
            

            Python :

            # coding=utf-8
            x=int(input())
            y=int(input())
            z=int(input())
            if x*x==z*z+y*y:
                print(round(z*y/2))
            elif z*z==x*x+y*y:
                print(round(x*y/2))
            elif y*y==x*x+z*z:
                print(round(x*z/2))
            else:
                print("no")
            
            • 1

            信息

            ID
            26
            时间
            1000ms
            内存
            128MiB
            难度
            1
            标签
            (无)
            递交数
            38
            已通过
            31
            上传者