This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = parseFloat(getUserInputValue("请输入土方下底面的长度", 100)); | |
b = parseFloat(getUserInputValue("请输入土方下底面的宽度", 100)); | |
x = parseFloat(getUserInputValue("请输入土方上底面的长度", 100)); | |
y = parseFloat(getUserInputValue("请输入土方上底面的宽度", 100)); | |
h = parseFloat(getUserInputValue("请输入土方的高度", 10)); | |
totalArea = eachArea(a,b,x,y,h)+eachArea(b,a,y,x,h); | |
print("短梯形的高是: "+sqrt((square((b-y)/2)) + square(h))); | |
print("长梯形的高是: "+sqrt((square((a-x)/2)) + square(h))); | |
print("每个短梯形的面积是: "+(eachArea(a,b,x,y,h))/2); | |
print("每个长梯形的面积是: "+(eachArea(b,a,y,x,h))/2); |