用电子表格EXCEL做一个程序,求四边形的周长和面积
答案:1 悬赏:10 手机版
解决时间 2021-02-21 15:19
- 提问者网友:临风不自傲
- 2021-02-21 07:37
利用FUNCTION ,,SUB, inputBox 输入2个边长,msgBox显示四边形的周长和面积
最佳答案
- 五星知识达人网友:像个废品
- 2021-02-21 08:02
Sub Main()
Dim length As Double
Dim wideth As Double
length = Application.InputBox(Prompt:= _
"请输入长", Type:=1)
wideth = Application.InputBox(Prompt:= _
"请输入宽", Type:=1)
MsgBox "面积为: " & AREA(length, wideth) & " 周长为: " & GIRTH(length, wideth)
End Sub
Function AREA(a, b)
AREA = a * b
End Function
Function GIRTH(c, d)
GIRTH = 2 * (c + d)
End Function
Dim length As Double
Dim wideth As Double
length = Application.InputBox(Prompt:= _
"请输入长", Type:=1)
wideth = Application.InputBox(Prompt:= _
"请输入宽", Type:=1)
MsgBox "面积为: " & AREA(length, wideth) & " 周长为: " & GIRTH(length, wideth)
End Sub
Function AREA(a, b)
AREA = a * b
End Function
Function GIRTH(c, d)
GIRTH = 2 * (c + d)
End Function
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯