判断三角形并计算面积

import math    
a = float(input())
b = float(input())
c = float(input())
if a + b > c and a + c > b and b + c > a:      
    girth = a + b + c       
    p = girth/2          
    area = math.sqrt(p * (p - a) * (p - b) * (p - c))  
    print('YES')
    print('{:.2f}'.format(area))
else:
    print('NO')

 

posted @ 2020-04-14 22:09  林晓婷  阅读(462)  评论(0)    收藏  举报