const T=50; var a: array [1..T,1..T] of integer; i,j,n,m:integer; begin write('Введите n: '); readln(n); write('Введите m: '); readln(m); for i:=1 to n do for j:=1 to m do readln(a[i,j]); for i:=1 to n do for j:=1 to m do if i=j then a[i,j]:=a[i,j]*2; for i:=1 to n do begin for j:=1 to m do write(a[i,j],' '); writeln; end; end.
const T=50;
var a: array [1..T,1..T] of integer;
i,j,n,m:integer;
begin
write('Введите n: ');
readln(n);
write('Введите m: ');
readln(m);
for i:=1 to n do
for j:=1 to m do readln(a[i,j]);
for i:=1 to n do
for j:=1 to m do if i=j then a[i,j]:=a[i,j]*2;
for i:=1 to n do
begin
for j:=1 to m do write(a[i,j],' ');
writeln;
end;
end.