Private Sub Command1_Click()
Print "======="
Dim a(20) As Integer
For i = 1 To 20
a(i) = Rnd * 20 + 1
Print a(i);
If i Mod 10 = 0 Then Print
Next i
Print "其中是质数的有:";
For i = 1 To 20
If ss(a(i)) Then Print a(i);
Next i
Print: Print
End Sub
Function ss(x As Integer) As Boolean
ss = False
For i = 2 To Sqr(x)
If x Mod i = 0 Then Exit Function
Next i
ss = True
End Function