DIM a(10)
PRINT "massiv"
FOR i = 1 TO 10
a(i) = INT(RND * 21) - 10
PRINT a(i); " ";
NEXT
PRINT
FOR i = 1 TO 10
IF a(i) > 0 THEN sum = sum + a(i)
IF a(i) < 0 THEN n = n + 1
NEXT
PRINT "summa polojit="; sum
PRINT "kol-vo otricat="; n
Тестирование выполнено в программе QB64 ( Скачать )