Private Sub Form_Click()
Dim n As Integer, i As Integer
n = InputBox("请输入要判断的数")
Call zh(n, i)
End Sub
Private Sub zh(n, i As Integer) ← 这里是sub
If n = 2 Or n = 3 Then
Print n & "是素数"
Else
For i = 2 To Sqr(n)
If n Mod i = 0 Then Exit For
Next i
If i > Sqr(n) Then
Print n & "是素数"
Else
Print n & "不是素数"
End If
End If
End Sub
希望能帮助你 感谢采纳