Option Explicit '添加一个按钮Command1 Private Function SS(ByVal num As Long) As Boolean Dim i As Long For i = 2 To num / 2 If num Mod i = 0 Then SS = False Exit Function End If SS = True Next End Function
Private Sub Command1_Click() Dim n As Long, count As Integer For n = 1000 To 1100 If SS(n) Then If count Mod 6 = 0 And count <> 0 Then Print "" count = count + 1 Print n; End If Next End Sub