DIM matrix(3, 3) AS INTEGER
DIM array(9) AS INTEGER
RANDOMIZE TIMER
INPUT "Введите количество строк: ", rows
INPUT "Введите количество столбцов: ", cols
FOR i = 1 TO rows
FOR j = 1 TO cols
matrix(i, j) = INT(RND * 21) - 10
NEXT j
NEXT i
index = 0
FOR i = 1 TO rows
FOR j = 1 TO cols
array(index) = matrix(i, j)
print array(index)
index = index + 1
NEXT j
Тестирование выполнено в программе QB64 ( Скачать )