三个数比较大小

来源:互联网 发布:淘宝侵犯肖像权赔偿 编辑:程序博客网 时间:2024/05/22 05:11

Private Sub Command1_Click()

Dim a As Integer

Dim b As Integer

Dim c As Integer

Dim max As Integer

 

a = Val(Text1.Text)

b = Val(Text2.Text)

c = Val(Text3.Text)

 

If a > b Then

  max = a

 Else

  max = b

End If

 

If c > max Then

  max = c

End If

 

Print max

 

End Sub