DIM a(50)
RANDOMIZE TIMER
PRINT "massiv"
FOR i = 1 TO 50
a(i) = INT(RND * 20) - 10
PRINT a(i);
NEXT
PRINT
FOR i = 1 TO 50
IF a(i) > 0 THEN s = s + a(i): k = k + 1
NEXT
PRINT "srednee polojitelnih="; s / k
Тестирование выполнено в программе QB64 ( Скачать )