VFP.使用循环结构程序验证387是否为素数.

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/03 13:40:09

VFP.使用循环结构程序验证387是否为素数.
VFP.使用循环结构程序验证387是否为素数.

VFP.使用循环结构程序验证387是否为素数.
clear
m=387
x=0
for i=2 to 386
if m/i=int(m/i)
x=1
endif
endfor
if x=0
?"387是素数"
else
?"387不是素数"
endif