任意6个值,我就以随机产生6个两位正整数为例好了,代码如下:
Private Sub Command1_Click()
Dim a(6) As Integer
For i = 1 To 6
Randomize
a(i) = Int(Rnd * 90) + 10
Print a(i);
Next i
Max = a(1)
Min = a(1)
For i = 1 To 6
If Max < a(i) Then Max = a(i)
If Min > a(i) Then Min = a(i)
Next i
Print "最大值为:" & Max
Print "最小值为:" & Min
End Su