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