python 求三角形面積

import math a = float(input()) #獲取輸入邊長a爲浮點型 b = float(input()) #獲取輸入邊長b爲浮點型 c = float(input()) #獲取輸入邊長c爲浮點型 if(a+b>c and a+c>b and b+c>a): #判斷是否能構成三角形 p = (a+b +c)/2 # 海倫公式 S = math.sqrt(p*(p-a)(p-b)(
相關文章
相關標籤/搜索