第1个回答 2014-10-30
Private Sub Command1_Click()
Dim a As Double, b As Double, c As Double, max As Double
a = Val(InputBox("a=?"))
b = Val(InputBox("b=?"))
c = Val(InputBox("c=?"))
max = IIf(a > IIf(b > c, b, c), a, IIf(b > c, b, c))
MsgBox "最大数为:" & max
End Sub
'或
Private Sub Command1_Click()
Dim a As Double, b As Double, c As Double, max As Double
a = Val(InputBox("a=?"))
b = Val(InputBox("b=?"))
c = Val(InputBox("c=?"))
If a > b Then
max = a
Else
max = b
End If
If c > max Then max = c
MsgBox "最大数为:" & max
End Sub本回答被网友采纳