INPUT n, m
DIM x(n, m)
RANDOMIZE TIMER
FOR i = 1 TO n
FOR j = 1 TO m
x(i, j) = INT(RND * 89) + 10
PRINT x(i, j);
NEXT j: PRINT
NEXT i: PRINT
FOR j = 1 TO m
FOR i = 1 TO m - 1
IF x(1, i) > x(1, i + 1) THEN
FOR q = 1 TO n
SWAP x(q, i), x(q, i + 1)
NEXT q
END IF
NEXT i
NEXT j
FOR i = 1 TO n
FOR j = 1 TO m
PRINT x(i, j);
NEXT j: PRINT
NEXT i