var n,i:longint; function polin(n:longint):boolean; var i,j:longint; s:string; itog:boolean; begin itog:=true; str(n,s); if length(s)=1 then itog:=false; for i:=1 to length(s) do begin j:=length(s)-i+1; if s[i]<>s[j] then itog:=false; end; polin:=itog; end; BEGIN n:=99; writeln('Chisla: '); for i:=1 to n do if polin(i*i) then writeln(i,' (',i*i,')'); end.
Answers & Comments
var n,i:longint;
function polin(n:longint):boolean;
var i,j:longint;
s:string;
itog:boolean;
begin
itog:=true;
str(n,s);
if length(s)=1 then itog:=false;
for i:=1 to length(s) do begin
j:=length(s)-i+1;
if s[i]<>s[j] then itog:=false; end;
polin:=itog;
end;
BEGIN
n:=99;
writeln('Chisla: ');
for i:=1 to n do
if polin(i*i) then
writeln(i,' (',i*i,')');
end.