10位数字的比较,找出最大值。

来源:互联网 发布:oracle的sql语句 编辑:程序博客网 时间:2024/06/06 07:21

Private Sub Command1_Click()

 

Dim a As Integer

 

Dim b As Integer

 

Dim c As Integer

 

Dim d As Integer

 

Dim e As Integer

 

Dim f As Integer

 

Dim g As Integer

 

Dim h As Integer

 

Dim i As Integer

 

Dim j As Integer

 

Dim max As Integer

 

a = InputBox("输入数字")

 

b = InputBox("输入数字")

 

c = InputBox("输入数字")

 

d = InputBox("输入数字")

 

e = InputBox("输入数字")

 

f = InputBox("输入数字")

 

g = InputBox("输入数字")

 

h = InputBox("输入数字")

 

i = InputBox("输入数字")

 

j = InputBox("输入数字")

 

If a > b Then

 

Print a

 

Else

 

Print b

 

End If

 

If b > c Then

 

Print b

 

Else

 

Print c

 

End If

 

If c > d Then

 

Print c

 

Else

 

Print d

 

End If

 

If d > e Then

 

Print d

 

Else

 

Print e

 

End If

 

If e > f Then

 

Print e

 

Else

 

Print f

 

End If

 

If f > g Then

 

Print f

 

Else

 

Print g

 

End If

 

If g > h Then

 

Print g

 

Else

 

Print h

 

End If

 

If h > i Then

 

Print h

 

Else

 

Print i

 

End If

 

If i > j Then

 

Print i

 

Else

 

Print j

 

End If

 

Print max

 

End SubEnd SubEnd Sub