『壹』 vb比較三個數的大小程序
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer
Dim max As Integer
Dim n As String
a = Val(InputBox("輸入第1個整數", "Input"))
b = Val(InputBox("輸入第2個整數", "Input"))
c = Val(InputBox("輸入第3個整數", "Input"))
max = a
n = "一"
If b > max Then
max = b
n = "二"
End If
If c > max Then
max = c
n = "三"
End If
MsgBox "三個數是:" & a & "," & b & "," & c & vbCrLf & "最大的版數是第" & n & "個:權" & max
End Sub