mirror of
https://github.com/tiennm99/CSX101.git
synced 2026-06-06 10:11:57 +00:00
19 lines
655 B
Python
19 lines
655 B
Python
import math
|
|
epsilon = 1E-10
|
|
a = float(input())
|
|
b = float(input())
|
|
c = float(input())
|
|
if (a + b > c and b + c > a and c + a > b):
|
|
p = (a + b + c)/2
|
|
s = round(math.sqrt(p*(p-a)*(p-b)*(p-c)), 2)
|
|
if (a == b or b == c or c == a):
|
|
if (a == b and b == c):
|
|
print("Tam giac deu, dien tich = %g" % s)
|
|
else:
|
|
print("Tam giac can, dien tich = %g" % s)
|
|
elif (abs(a*a + b*b - c*c) < epsilon or abs(b*b + c*c - a*a) < epsilon or abs(c*c + a*a - b*b < epsilon)):
|
|
print("Tam giac vuong, dien tich = %g" % s)
|
|
else:
|
|
print("Tam giac thuong, dien tich = %g" % s)
|
|
else:
|
|
print("Khong phai tam giac") |