10.import math# 输入三条边a float(input(请输入三角形的边A))b float(input(请输入三角形的边B))c float(input(请输入三角形的边C))# 判断是否能构成三角形if a 0 and b 0 and c 0 and (a b c) and (a c b) and (b c a):# 计算周长perimeter a b c# 计算半周长h perimeter / 2# 海伦公式计算面积area math.sqrt(h * (h - a) * (h - b) * (h - c))# 输出结果保留1位小数print(f三角形三边分别为a{round(a,1)}, b{round(b,1)}, c{round(c,1)})print(f三角形的周长 {round(perimeter,1)}, 面积 {round(area,1)}) else:print(无法构成三角形)11.import math# 先默认计算x0的情况y math.log(-5 * x) 6 * math.sqrt(abs(x)) math.exp(4) - (x 1)**3# 单分支如果x≥0覆盖重新计算if x 0: y (x**2 - 3 * x) / (x 1) 2 * math.pi math.sin(x) return y12.import math# 导入数学库用于开平方def solve_quadratic():求解一元二次方程 ax² bx c 0# 输入系数转换为浮点数try:a float(input(请输入系数a))b float(input(请输入系数b))c float(input(请输入系数c))except ValueError:print(输入错误请输入数字类型的系数。)return# 情况1a0 且 b0if a 0 and b 0: print(此方程无解)# 情况2a0 且 b≠0elif a 0:x -c / bprint(f此方程的解为{x})# 情况3a≠0else: delta b**2 - 4 * a * c