Python判断三角形并计算面积
a, b, c = map(int, input().split()) if a + b > c and a + c > b and b + c > a: p = (a + b + c) / 2 area = (p * (p - a) * (p - b) * (p - c)) ** 0.5 print('YES', '{:.2f}'.format(area)) else: print('NO')
原文地址: https://www.cveoy.top/t/topic/orlq 著作权归作者所有。请勿转载和采集!