DIM a(15)
DATA 7,8,-4,3,5,1,-2,3,-4,5,4,3,0,-1,-5
FOR i = 1 TO 15
READ a(i)
NEXT
PRINT "massiv"
FOR i = 1 TO 15
PRINT a(i);
NEXT
PRINT
FOR i = 1 TO 15
IF a(i) = 3 THEN k = k + 1
NEXT
FOR i = 1 TO 15
IF a(i) = 3 THEN m = m + 1
IF m >= k - 1 AND a(i) > 0 THEN s = s + a(i)
NEXT
PRINT "s="; s - 3
Тестирование выполнено в программе QB64 ( Скачать )