level 1
🌙浮歌
楼主
刚编的程序,求10000~20000的回文素数。可是结果不对啊,全是0
还有明天就要默了![[揉脸]](/static/emoticons/u63c9u8138.png)
dim n as integer
dim old as integer
dim new as integer
dim d as integer
dim i as integer
dim f as integer
dim s as integer
for old=10000 to 20000
f=0
for s=2 to n\2
if n mod s=0 then f=1
next s
if f=0 then
old =i
new=0
do
d=old mod 10
new=new*+d
old=old\10
loop until old=0
if i=new then print i
end if
next old
sleep
end
2013年03月08日 11点03分
1
dim n as integer
dim old as integer
dim new as integer
dim d as integer
dim i as integer
dim f as integer
dim s as integer
for old=10000 to 20000
f=0
for s=2 to n\2
if n mod s=0 then f=1
next s
if f=0 then
old =i
new=0
do
d=old mod 10
new=new*+d
old=old\10
loop until old=0
if i=new then print i
end if
next old
sleep
end