大牛,帮改改

var a,b,c,h,e,f:longint;

g:boolean;

d:string;

begin

read(a,b);

for c:=a to b do

begin

str(c,d);

f:=length(d);

if f>=8 then halt;

g:=true;

if (c mod 2=0)or(c mod 3=0)or(c mod 5=0)or(c mod 7=0) then

g:=false

else

begin

for h:=2 to trunc(sqrt(c))do

if c mod h=0 then begin g:=false; break; end;

if gfalse then

begin

for e:=1 to (f div 2)+1 do

if d[e]d[f-(e-1)] then

begin

g:=false;

break;

end;

end;

end;

if (g=true) then writeln(c);

end;

end.                         

0 条评论

目前还没有评论...

信息

ID
1042
难度
7
分类
搜索 | 搜索与剪枝 点击显示
标签
(无)
递交数
6585
已通过
1516
通过率
23%
被复制
13
上传者