Создать массив:
1 0 2 0
0 3 0 4
2 0 3 0
0 4 0 1
CLS
DIM a(4, 4)
DATA 1,0,2,0,0,3,0,4,2,0,3,0,0,4,0,1
PRINT "massiv"
FOR i = 1 TO 4
FOR j = 1 TO 4
READ a(i, j)
PRINT a(i, j);
NEXT
PRINT
NEXT
FOR i = 1 TO 4
FOR j = 1 TO 4
IF a(i, j) = 0 THEN FOR k = j TO 3: a(i, k) = a(i, k + 1): NEXT: a(i, 4) = 0
NEXT
NEXT
PRINT "novyj massiv"
FOR i = 1 TO 4
FOR j = 1 TO 4
PRINT a(i, j);
NEXT
PRINT
NEXT
Тестирование выполнено в программе QB64 ( Скачать )