11 lines
300 B
Python
11 lines
300 B
Python
# 编写一个程序,输入三角形的底和高,计算并输出其面积。
|
|
# 输入底和高
|
|
base = float(input("请输入三角形的底: "))
|
|
height = float(input("请输入三角形的高: "))
|
|
|
|
# 计算面积
|
|
area = 0.5 * base * height
|
|
|
|
# 输出结果
|
|
print(f"三角形的面积是: {area}")
|