INPUT "razmernost m ", m
INPUT "razmernost n ", n
DIM b(m, n), a(m * n), c(m * n)
FOR i = 1 TO m
FOR j = 1 TO n
INPUT "vvedite element ", b(i, j)
NEXT
NEXT
FOR i = 1 TO m
FOR j = 1 TO n
IF b(i, j) < 0 THEN k = k + 1: c(k) = b(i, j) ELSE p = p + 1: a(p) = b(i, j)
NEXT
NEXT
FOR i = 1 TO p
PRINT a(i);
NEXT
PRINT
FOR i = 1 TO k
PRINT c(i);
NEXT
Тестирование выполнено в программе QB64 ( Скачать )