CLS
DIM A(1 TO 12, 1 TO 12)
FOR i = 1 TO 12
FOR j = 1 TO 12
A(i, j) = INT(RND * 10)
NEXT j
NEXT i
maxR = 1
maxC = 1
maxVal = A(1, 1)
FOR i = 1 TO 12
FOR j = 1 TO 12
IF A(i, j) > maxVal THEN
maxR = j
maxC = i
maxVal = A(i, j)
END IF
NEXT j
NEXT i
IF maxR + 1 < 12 THEN
FOR i = maxR + 1 TO 12
FOR j = 12 TO i + 1 STEP -1
IF A(j - 1, maxC) > A(j, maxC) THEN
tmp = A(j - 1, maxC)
A(j - 1, maxC) = A(j, maxC)
A(j, maxC) = tmp
END IF
NEXT j
NEXT i
END IF