zz,的作业

发布时间:2026/6/26 11:35:51

zz,的作业 第二题import math a float(input(请输入直角三角形的直角边1(0))) b float(input(请输入直角三角形的直角边2(0))) c math.sqrt(a ** 2 b ** 2) print(f直角三角形的斜边为{c:.2f})第三题def getValue(b, r, n): return b * (1 r) ** n principal float(input(请输入本金)) rate float(input(请输入年利率)) years int(input(请输入年份)) final_amount getValue(principal, rate, years) print(f本金利率和为{final_amount:.2f})第四题import math r float(input(请输入球的半径)) area 4 * math.pi * r ** 2 volume (4 / 3) * math.pi * r ** 3 print(f球为表面积为{area:.2f}体积为{volume:.2f})

相关新闻