第一题答案:
Option Explicit
Private Sub Command1_Click()
Dim n As Integer
n = Val(InputBox("请输入一个数"))
If isprime(n) Then
Print n; "是素数"
Else
Print n; "不是素数"
End If
End Sub
Private Function isprime(m As Integer) As Boolean
Dim i As Integer
isprime = True
For i = 2 To Sqr(m)
If m Mod i = 0 Then
isprime = False
Exit For
End If
Next i
End Function