CLEAR
input "请输入自然数( > = 3) :" to n
f = 0
FOR i=2 TO INT(SQRT(n))
IF MOD(n,i)=0
f=1
EXIT for
ELSE
f=0
ENDIF
ENDFOR
IF f=0
str(n) + "是素数"
else
str(n) + "不是素数"
endif
return
= 3) :" to nf = 0FOR i=2 TO INT(SQRT(n))IF MOD(n,i)=0" property="og:description"/>
CLEAR
input "请输入自然数( > = 3) :" to n
f = 0
FOR i=2 TO INT(SQRT(n))
IF MOD(n,i)=0
f=1
EXIT for
ELSE
f=0
ENDIF
ENDFOR
IF f=0
str(n) + "是素数"
else
str(n) + "不是素数"
endif
return