如果我没读错题,这个应该能基本满足你的要求
Option Base 1
Dim x%(100)
Private Sub Form_Load()
Form1.AutoRedraw = True
Dim a%
a = Val(InputBox("请输入需要统计的个位数", "输入"))
Randomize
For i = 1 To 100
x(i) = Int(61 * Rnd + 30)
Print x(i);
If i Mod 10 = 0 Then Print
Next
Print
Call total(a)
End Sub
Private Sub total(a%)
Dim sum%
sum = 0
For i = 1 To 100
If x(i) Mod 10 = a Then
sum = sum + 1
End If
Next i
Print "这100个数中个位为" & a & "的数有" & sum & "个"
End Sub