使用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)
相关文章
相关标签/搜索