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