INPUT "vvedite razmer massiva ", n
DIM a(n), b(n)
FOR i = 1 TO n
INPUT "vvedite element ", a(i)
NEXT
PRINT "massiv"
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
nmax = 1
FOR i = 1 TO n
IF a(i) > 0 THEN k = k + 1: b(k) = a(i)
IF a(i) > a(nmax) THEN nmax = i
NEXT
PRINT "nomer maximalnogo elementa="; nmax
PRINT "novyj massiv"
FOR i = 1 TO k
PRINT b(i);
NEXT
Тестирование выполнено в программе QB64 ( Скачать )