Var
N1,N2,A:integer;
B:longint;
k:boolean;
Begin
Write('N1 = ');ReadLn(N1);
Write('N2 = ');ReadLn(N2);
For N2:= N1 to N2 do
Begin
k:=true;
A:=N2;
B:=A*A;
While A<>0 do
Begin
if (A mod 10 <> B mod 10) then k:=false;
A:= A div 10;
B:= B div 10;
End;
if k then Write(N2,' ');
End;
End.
Пример:
N1 = 0
N2 = 65536
0 1 5 6 25 76 376 625 9376