Const n=3; var a:array[1..n, 1..n] of integer; i,j:integer; begin writeln('Введите элементы матрицы'); for i:=1 to n do for j:=1 to n do begin read(a[i,j]); if i=j then a[i,j]:=0; end; writeln; for i:=1 to n do begin for j:=1 to n do write(a[i,j], ' '); writeln; end; end.
n=3;
var a:array[1..n, 1..n] of integer;
i,j:integer;
begin
writeln('Введите элементы матрицы');
for i:=1 to n do
for j:=1 to n do begin
read(a[i,j]);
if i=j then a[i,j]:=0;
end;
writeln;
for i:=1 to n do begin
for j:=1 to n do write(a[i,j], ' ');
writeln;
end;
end.