CLEAR
lncnt=0
lnnum=123456789098765
if (lnnum>=4 and (inlist(mod(lnnum,6),0,2,3,4))) or mod(lnnum,5)=0
return messagebox("["+transform(lnnum)+"]不是质数")
endif
messagebox("12345")
for lnI=2 to lnnum
if mod(lnnum,lnI)=0
?lnI
lncnt=lncnt+1
if lncnt>5
exit
endif
endif
endfor
if lncnt>1
lcstr="["+transform(lnnum)+"]不是质数"
else
lcstr="["+transform(lnnum)+"]是质数"
endif
messagebox(lcstr)
判断一个数是否是质数的方法
最新推荐文章于 2020-04-15 14:43:09 发布