4 条题解
-
0
#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
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
- 标签
- (无)
- 递交数
- 33
- 已通过
- 26
- 上传者