DIM f(20)
RANDOMIZE TIMER
FOR i = 1 TO 20
f(i) = INT(RND * 40) - 15
NEXT
PRINT "massiv"
FOR i = 1 TO 20
PRINT f(i);
NEXT
PRINT
FOR i = 1 TO 20
IF f(i) > 0 THEN spol = spol + f(i) ELSE IF f(i) < 0 THEN sotr = sotr + f(i)
NEXT
PRINT "spol="; spol
PRINT "sotr="; sotr
IF spol > ABS(sotr) THEN
FOR i = 1 TO 20
IF f(i) > 0 THEN f(i) = 0
NEXT
END IF
PRINT "novyj massiv"
FOR i = 1 TO 20
PRINT f(i);
NEXT