procedure ascendentes(n,m: byte ; mat: tipomat);
var
i,j,suma: byte ;
begin
suma:=0;
i:=2;
for j:=1 to m do
begin
while (i<=n) and (mat[i,j]>mat[i-1,j]) do
begin
i:= i+1;
suma:= suma+1;
end;
end;
writeln(i,'...',suma);
if i> n then
writeln('cumple con ',suma)
else
writeln('no cumple ');
end;
// It doesn't calculate the number of columns correctly. I'm using pascal