INPUT "Razmernost massiva="; n
DIM a(n)
RANDOMIZE TIMER
FOR i = 1 TO n
a(i) = INT(RND * 300) - 150
NEXT i
FOR i = 1 TO n
PRINT a(i);
NEXT i
PRINT
FOR i = 1 TO n
IF a(i) > 100 THEN a(i) = a(i) / 2
IF (a(i) >= 0) AND (a(i) <= 100) THEN a(i) = a(i) + 2
IF a(i) < 0 THEN a(i) = 0
NEXT i
FOR i = 1 TO n
PRINT a(i);
NEXT i
Следующий вариант
INPUT "n=", n
DIM a(n)
FOR i = 1 TO n
INPUT "a(i)=", a(i)
NEXT
FOR i = 1 TO n
IF a(i) > 100 THEN PRINT a(i) / 2
IF a(i) > 0 AND a(i) < 100 THEN PRINT a(i) * 2
IF a(i) < 0 THEN PRINT 0
NEXT
Тестирование выполнено в программе QB64 ( Скачать )