第1个回答 2015-03-30
Sub IfPrimeNumber()
dim n%,blnNoPrimeN as Boolean
if n<1 then msgbox "素数必须是正整数":eixt sub
for cx=2 to n-1
if 0=(n mod cx) then blnNoPrimeN=True : Exit For
next
if blnNoPrimeN then
msgbox n & "不是素数"
else
msbox n & "是素数"
endif
End Sub本回答被网友采纳
第2个回答 2015-03-30
sub main
dim i as integer, n as integer
n = inputbox("Number", "Number")
for i = 2 to n - 1
if n mod i = 0 then
exit for
end if
next
print "no"
goto ends
print "yes"
ends:
end sub