INPUT "vvedite kolichestvo elementov n=", N
DIM a(N), s(N)
RANDOMIZE TIMER
PRINT "posledovatelnost"
FOR i = 1 TO N
a(i) = INT(RND * 20) - 10
PRINT a(i); " ";
NEXT
PRINT
FOR i = 1 TO N
IF a(i) < 0 THEN k = k + 1 ELSE s(k) = s(k) + 1
NEXT
FOR i = 1 TO k - 1
IF s(i) > max THEN max = s(i)
NEXT
PRINT "maximalnoe kolichestvo poloj="; max
Тестирование выполнено в программе QB64 ( Скачать )