roberthsu2003 / __2024_05_05_sunday__

AI 人工智慧開發入門_python
30 stars 3 forks source link

請寫一個計算梯形面積的程式碼? #3

Closed Remainder1996 closed 5 months ago

Remainder1996 commented 5 months ago

梯形面積,(上底+下底) * 高 / 2

top = 4.5
bottom = 8.0
height = 3.5

area = (top + bottom) * height / 2
print("梯形面積:",area)