Private Sub Command1_Click()
Dim a As Integer, n As Integer, i As Integer, x As Integer, s As Long
a = 500
n = 0
s = 0
Do While n < 100
a = a + 1
x = 0
For i = 2 To a - 1
If a Mod i = 0 Then
x = x + 1
Exit For
End If
Next
If x = 0 Then
n = n + 1
Print a;
s = s + a
If n Mod 10 = 0 Then
End If
End If
Loop
Print "500以后100个素数的和=", s
End Sub