vb中求任意六个值中最大值和最小值

问题描述:

vb中求任意六个值中最大值和最小值
是在这种界面上的

Private Sub Form_Click()
Dim n(5) As Integer,nMax As Integer,nMin As Integer,i As Integer
Randomize
Print "六个数分别是:";
For i = 0 To 5
n(i) = Int(Rnd * 100)
Print n(i);
Next
Print
nMax = n(0)
nMin = n(0)
For i = 1 To 5
If n(i) > nMax Then nMax = n(i)
If n(i) Next
Print "最大值是:" & nMax
Print "最小值是:" & nMin
End Sub