用VB编写程序(找出三个数中的最大数,通过INPUTBOX函数获得三个数)

如题所述

Private Sub Command1_Click()
Dim a As Single
Dim b As Single
Dim c As Single
Dim max As Single

a = Val(InputBox("输入第1个数"))
max = a
b = Val(InputBox("输入第2个数"))
If b > max Then max = b
c = Val(InputBox("输入第3个数"))
If c > max Then max = c
MsgBox "最大数是" & max
End Sub
温馨提示:答案为网友推荐,仅供参考
相似回答