type IntRange Positive var 1 . . Maximum; 1 . . MaxInt; N: IntRange; function Palindrome (Squar' : Positive): Boolean; const Places = 5 { = Trunc( ~glO(Sqr(Maximum))) + 1 }; type NPlaces = 1 . . Places; SingleDigit = O .. 9; DigitVec = array [NPI ~es] of SingleDigit; var Digits: DigitVec; Size: NPlaces; procedure CrackDigits; begin Size := 1; while Square > 9 do b, 'ft n Digits[Size] := Squ :e mod 10; Square := Square di LO; Size := Size + 1 end; Digits [Size] : = Squan end { CrackDigits }; function CheckSymmetry( ,~ft,Right:NPlaces) :Boolean; begin if Left >= Right then t:heckSymmetry := true else if Digits [Left] = D 'flts[Right] then CheckSymmetry:=ChkSymmetry(Left+l, Right-I) else CheckSymmetry end { CheckSymmetry }; begin { Palindrome } CrackDigits; false Palindrome := CheckSymm :y(l, S~ze) end { Palindrome }; begin for N := 1 to Maximum do if Palindrome (Sqr(N) ) t'I'11 Writeln(N, , squared; a palindrome.') end { IsItAPalindrome } . 

