发布网友 发布时间:2024-10-24 16:47
共1个回答
热心网友 时间:1天前
Private Sub Form_Load()
Dim a, b, c As Single
Dim p , s As Single
a = Val(InputBox("请输入边长1"))
b = Val(InputBox("请输入另一边长"))
c = Val(InputBox("请输入最后一个边长"))
If a + b <= c Or a + c <= b Or b + c <= a Then
MsgBox ("不能构成三角形")
Else
p = (a + b + c) / 2
s = Sqr(p * (p - a) * (p - b) * (p - c))
MsgBox s
End If
End
End Sub