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