INPUT "vvedite kol-vo elementov ", n
DIM a(n)
RANDOMIZE TIMER
FOR i = 1 TO n
a(i) = INT(RND * 20) - 10
NEXT
PRINT "massiv"
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
i = 0
DO WHILE (a(i) <> 2) AND (i < n)
i = i + 1
IF a(i) <> 2 THEN s = s + a(i)
IF a(i) = 2 THEN f = 1
LOOP
IF f = 1 THEN PRINT "summa="; s ELSE PRINT "dvojki net"