AcWing 666. 三角形类型 Python3
原题链接
困难
作者:
sE@_0tT3r
,
2021-04-02 05:30:05
,
所有人可见
,
阅读 405
Python3 代码
a, b, c = input().split()
a = eval(a)
b = eval(b)
c = eval(c)
if a >= b and a >= c:
A = a
if b > c:
B = b
C = c
else:
B = c
C = b
elif b >= a and b >= c:
A = b
if a > c:
B = a
C = c
else:
B = c
C = a
elif c >= b and c >= a:
A = c
if b > a:
B = b
C = a
else:
B = a
C = b
if A >= B + C:
print("NAO FORMA TRIANGULO")
else:
if A*A == B*B + C*C:
print("TRIANGULO RETANGULO")
if A*A > B*B + C*C:
print("TRIANGULO OBTUSANGULO")
if A*A < B*B + C*C:
print("TRIANGULO ACUTANGULO")
if A == B == C:
print("TRIANGULO EQUILATERO")
if A == B != C or A == C != B or B == C != A:
print("TRIANGULO ISOSCELES")