for i:=1 to n do begin
for j:=1 to n do write(A[i,j]:3);
writeln;
end;
for i:=1 to n do begin
for j:=1 to n do MemoMS.Text:=MemoMS.Text + IntToStr(A[i,j]:3);
MemoMS.Text:=MemoMS.Text + #13#10;
end;
var
str: string;
begin
str := '';
for i := 1 to n do begin
for j := 1 to n do begin
str := str + ' ' + IntToStr(A[i, j]);
end;
MemoMS.Lines.Add(str);
str := '';
end;
end;