Var a:array [1..50,1..50] of integer;
m,n,i,j,k,b:integer;
begin
writeln ('Введи количество столбцов и строк');
readln (n,m);
for i:=1 to n do begin
for j:=1 to m do begin
a[i,j]:=random(21)-10;
write (a[i,j]:4);
end;
writeln;
end;
for i:=1 to n do
for j:=1 to m do
if n=i+j-1 then begin
k:=a[i,j];
b:=b+1;
a[i,j]:=a[b,1
];
a[b,1]:=k;
end;
writeln;
for i:=1 to n do begin
for j:=1 to m do
write (a[i,j]:4);
writeln;
end;
readln;
end.