2 条题解

  • 1
    @ 2025-6-15 11:07:56
    #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-24 9:14:29

      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
      439
      时间
      1000ms
      内存
      128MiB
      难度
      10
      标签
      (无)
      递交数
      2
      已通过
      2
      上传者