{Нужно обратить внимание, в каких пределах меняются переменные}
Program PRACT5; Uses CRT; Var a,b,c,d: byte; N1, N2: LongInt; Begin ClrScr; For a := 3 to 9 do Begin For b := 0 to 6 do Begin If not (b in [0,1,5,6]) then Continue; For c := 1 to 9 do Begin For d := 0 to 9 do Begin N2 := 0; N1 := ((a * 100) + (a * 10) + b); N1 := N1 * N1; N2:=(c*100000)+(c*10000)+ (d*1000)+(b*100)+(d*10)+b; If (N1 = N2) then Writeln(a,a,b,'^2 = ',c,c,d,b,d,b); End; End; End; End; ReadKey; End.