INPUT "Array length: "; N
DIM A(1 TO N), B(1 TO N)
max = -1000: imax = 0
min = 1000: imin = 0
RANDOMIZE TIMER
FOR i = 1 TO N
A(i) = FIX(RND * 101 - 50)
IF A(i) > max THEN
max = A(i)
imax = i
END IF
IF A(i) < min THEN
min = A(i)
imin = i
END IF
NEXT
N = 1
FOR i = 1 TO N
IF i <> imax AND i <> imin THEN
B(N) = A(i)
N = N + 1
PRINT B(N);
END IF
NEXT
PRINT
Тестирование выполнено в программе QB64 ( Скачать )