使用Python計算三角形的周長和麪積(海倫公式)

import math a=int(input("請輸入三角形的第一條邊")) b=int(input("請輸入三角形的第二條邊")) c=int(input("請輸入三角形的第三條邊")) zc,mj,s=0,0,0 if a+b>c and a+c>b and b+c>a: zc=a+b+c p=zc/2 mj=(p*(p-a)*(p-b)*(p-c))**(1/2)
相關文章
相關標籤/搜索