十万火急!!!急求VB高手帮我做一下这倒程序改错题,每个FOUND的下一行都有错误,请改正!

2024-12-25 16:49:22
推荐回答(1个)
回答1:

Private Sub Form_Click()
Dim n As Integer, k As Integer, i As Integer, swit As Integer
For n = 101 To 300 Step 2
k = Int(Sqr(n))
i = 2
'**********FOUND**********
swit = 0
'**********FOUND**********
While i <= k
If n Mod i = 0 Then
swit = 1
i = k + 1
Else
'**********FOUND**********
i = i + 1
End If
Wend
If swit = 0 Then
Print n;
End If
Next n
End Sub