Pascal
uses
SysUtils,Math;
var n,i:integer;
r:real;
begin
WriteLn('vvedi n:');
ReadLn(n);
i:=1;
while i*i<n do
begin
r:=n-i*i;
if sqrt(r)=floor(sqrt(r)) then
WriteLn(sqrt(r):1:0,',',i);
i:=i+1;
end;
ReadLn;
end.
Delphi
uses Math;
procedure TForm1.Button1Click(Sender: TObject);
var n,i:integer;
r:real;
begin
n:=StrToInt(Edit1.Text);
i:=1;
while i*i<n do
begin
r:=n-i*i;
if sqrt(r)=floor(sqrt(r)) then
Memo1.Lines.Add(FloatToStr(sqrt(r))+','+IntToStr(i));
i:=i+1;
end;
end;