VB比较三个数大小 哪个最大就点哪个

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/18 11:30:55
VB比较三个数大小哪个最大就点哪个VB比较三个数大小哪个最大就点哪个VB比较三个数大小哪个最大就点哪个OptionExplicitPrivateSubForm_Load()DimaAsLong,bAs

VB比较三个数大小 哪个最大就点哪个
VB比较三个数大小 哪个最大就点哪个

VB比较三个数大小 哪个最大就点哪个
Option Explicit
Private Sub Form_Load()
Dim a As Long, b As Long, c As Long
a = InputBox("请输入第1个数:", "输入")
b = InputBox("请输入第2个数:", "输入")
c = InputBox("请输入第3个数:", "输入")
Dim Max As Long
Max = a
If b > a Then
Max = b
End If
If c > b Then
Max = c
End If
MsgBox "其中:" & Max & "最大"
End Sub