AcWing 666. 三角形类型 - Python3
原题链接
困难
作者:
KYCygni
,
2021-03-09 15:23:45
,
所有人可见
,
阅读 258
Python3 代码
n = input().split()
A = eval(n[0])
B = eval(n[1])
C = eval(n[2])
if A < B:
A, B = B, A
if A < C:
A, C = C, A
if B < C:
B, C = C, B
A2 = A*A
B2 = B*B
C2 = C*C
if (A >= B + C):
print ("NAO FORMA TRIANGULO")
elif ( A2 == B2 + C2):
print ("TRIANGULO RETANGULO")
elif ( A2 > B2 + C2):
print ("TRIANGULO OBTUSANGULO")
elif ( A2 < B2 + C2):
print ("TRIANGULO ACUTANGULO")
if ( A == B and A == C):
print ("TRIANGULO EQUILATERO")
elif ( A == B or A == C or B == C):
print ("TRIANGULO ISOSCELES")