看下有什么错。。为什么输不出来。。 单步调试的时候又能输得出。。
program pprime1;
var a,b,k:longint; sum:boolean;
sushu:array[1..10000000] of 0..1 ;
procedure pprime(x,y:longint);
var i,j:longint;
begin
for i:=x to y do
for j:=2 to trunc(sqrt(i)) do
if (i mod j=0) then sushu:=0;
end;
function huiwen(x:longint):boolean;
var i1,j1:longint; s,s1,s2:string;
begin
str(x,s);
i1:=length(s);
s1:=copy(s,1,i1 div 2);
s2:=copy(s,(i1 div 2 +1),i1);
for j1:=11 to i1 div 2 do
if s1[j1]=s2[i1-j1] then huiwen:=true else huiwen:=false;
end;
begin
read(a,b);
for k:=a to b do
sushu[k]:=1;
pprime(a,b);
for k:=a to b do
if sushu[k]=1 then
begin
sum:=huiwen(k);
if sum=true then
writeln(k);
end;
end.