a=float(input('输入三角形第一条边')) b=float(input('输入三角形第二条边')) c=float(input('输入三角形第三条边')) if a+b>c and a+c>b and b+c>a: p=(a+b+c)/2 s=(p*(p-a)*(p-b)*(p-c))**0.5 print(2*p,round(s,2)) else: print('这三条边不能构成三角形')
使用您的 RDTedu 通用账户