- 捕风捉影
- 2012-08-20 16:13:43 @
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 条评论
目前还没有评论...