CLS
RANDOMIZE TIMER
n = 12
DIM a(n)
FOR i = 1 TO n: a(i) = FIX(RND * 100 - 50): NEXT
FOR i = 1 TO n
IF ABS(a(i)) > 15 THEN k = k + 1
NEXT
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
PRINT "k ="; k
Тестирование выполнено в программе QB64 ( Скачать )