DIM a(15)
RANDOMIZE TIMER
PRINT "massiv"
FOR i = 1 TO 15
a(i) = INT(RND * 11) - 5
PRINT a(i); " ";
NEXT
PRINT
pol = 1
otr = 1
FOR i = 1 TO 15
IF a(i) > 0 THEN pol = pol * a(i)
IF a(i) < 0 THEN otr = otr * a(i)
NEXT
PRINT "proizv polojit="; pol
PRINT "proizv otrcat="; otr
Тестирование выполнено в программе QB64 ( Скачать )