INPUT m
INPUT n
DIM a(m, n)
DIM b(m * n)
FOR i = 1 TO m
FOR j = 1 TO n
INPUT a(i, j)
NEXT
NEXT
FOR i = 1 TO m
FOR j = 1 TO n
PRINT a(i, j);" ";
NEXT
PRINT
NEXT
PRINT
FOR i = 1 TO m
FOR j = 1 TO n
k = k + 1
b(k) = a(i, j)
NEXT
NEXT
FOR i = 1 TO k
PRINT b(i); " ";
NEXT