1、Private Sub Command1_Click()
Randomize
Dim a(1 To 10)
For i = 1 To 10
a(i) = Int(Rnd * 10000) + 1
Print a(i)
Next i
Min = 10000
For i = 1 To 10
If a(i) < Min Then Min = a(i)
Next i
Print "最小值为"; Min
End Sub
2、
Private Sub VScroll1_Change()
Randomize
n = Int(Rnd() * 19) + 2
Text1.Text = n
For i = 1 To n
p = 1
For j = 1 To i
p = p * j
Next j
s = s + p
Next i
Label1.Caption = s
Label2.Caption = "1!+2!+...+" & n & "!="
End Sub
(2)Private Sub HScroll1_Change()
Dim sum As Long
Dim n As Integer
sum = 1
Text1.Text = HScroll1.Value
For n = 1 To Val(Text1.Text)
sum = sum * n
Next
Label1.Caption = sum
End Sub
(1)Private Sub Command1_Click()
Dim a(1 To 10) As Integer
randomize
For i = 1 To 10
a(i) = Int(Rnd * 100)
Print a(i);
Next
Print
Min = a(1)
For i = 2 To 10
If Min > a(i) Then
Min = a(i)
End If
Next
min(x)