Const
n=5;m=10;
var
b:array[1..n,1..m]of integer;
i,j,k,buf,l:integer;
begin
for i:=1 to n do
begin
writeln;
for j:=1 to m do
begin
b[i,j]:=random(50);
write(b[i,j]:4);
end;
end;
writeln;
for j:=1 to m do
begin
k:=0;
for i:=1 to n-1 do
if b[i,j] k:=k+1;
if k=n-1 then
buf:=buf+1;
end;
k:=0;
for l:=2 to m do
if l mod 2=0 then
for i:=1 to n-1 do
for j:=i+1 to n do
if b[i,l]>b[j,l]then
begin
k:=b[i,l];
b[i,l]:=b[j,l];
b[j,l]:=k;
end;
writeln('увеличилось ',m div 2-buf);
for i:=1 to n do
begin
writeln;
for j:=1 to m do
write(b[i,j]:4);
end;
end.