CLS RANDOMIZE TIMER INPUT "K = ", K INPUT "L = ", L DIM X!(K, L) FOR i = 1 TO K FOR j = 1 TO L X(i, j) = RND * 21 - 10 PRINT USING "###"; X(i, j); PRINT ; " "; NEXT j PRINT NEXT i FOR i = 1 TO L * 4 - 1 PRINT ; "_"; NEXT i PRINT FOR N = 1 TO L FOR i = 1 TO L - N - 1 IF X(i, 2) < X(i + 1, 2) THEN B = X(i, 2) X(i, 2) = X(i + 1, 2) X(i + 1, 2) = B END IF NEXT i NEXT N
FOR i = 1 TO K FOR j = 1 TO L PRINT USING "###"; X(i, j); PRINT " "; NEXT j PRINT NEXT i END
CLS
RANDOMIZE TIMER
INPUT "K = ", K
INPUT "L = ", L
DIM X!(K, L)
FOR i = 1 TO K
FOR j = 1 TO L
X(i, j) = RND * 21 - 10
PRINT USING "###"; X(i, j);
PRINT ; " ";
NEXT j
PRINT
NEXT i
FOR i = 1 TO L * 4 - 1
PRINT ; "_";
NEXT i
PRINT
FOR N = 1 TO L
FOR i = 1 TO L - N - 1
IF X(i, 2) < X(i + 1, 2) THEN
B = X(i, 2)
X(i, 2) = X(i + 1, 2)
X(i + 1, 2) = B
END IF
NEXT i
NEXT N
FOR i = 1 TO K
FOR j = 1 TO L
PRINT USING "###"; X(i, j);
PRINT " ";
NEXT j
PRINT
NEXT i
END