Private Sub Command1_Click()
Dim a(10) As Integer
Randomize
Print "产生的随机数是:"
For i = 1 To 10
a(i) = Int(Rnd * 51)
Print a(i);
Next i
Print
x = CInt(InputBox("请输入要查找的数:"))
Print "要查找的数是:"; x
n = 0
For i = 1 To 10
If x = a(i) Then n = n + 1
Next i
Print "出现了"; n; "次"
Print: Print
End Sub