求助! 如何用vb编三个数比较大小
各位大哥,我遇到了个难题,如何用vb编一个程序:输入三个数,然后按由大到小的顺序显示谢谢各位,小弟刚学vb,请多关照!
Option Explicit
Private Sub Command1_Click()
Dim demoNum(1 To 3) As Integer
Dim i As Integer, j As Integer
Dim temp As Integer
For i = 1 To 3
demoNum(i) = Rnd * 15
Next
For i = 1 To 3
For j = 1 To 3 - i
If demoNum(j) < demoNum(j + 1) Then
temp = demoNum(j)
demoNum(j) = demoNum(j + 1)
demoNum(j + 1) = temp
End If
Next
Next
For i = 1 To 3
Print demoNum(i);
Next
End Sub