CLS
DIM A(30)
RANDOMIZE TIMER
FOR i = 1 TO 30
A(i) = INT(RND * 200) - 100
NEXT i
FOR i = 1 TO 30
PRINT A(i);
NEXT i
PRINT
max = A(1): min = A(1)
FOR i = 2 TO 30
IF A(i) > max THEN max = A(i)
IF A(i) < min THEN min = A(i)
NEXT i
s = (min + max) / 2
PRINT "Srednee arifmeticheskoye="; s
END
Тестирование выполнено в программе QB64 ( Скачать )