CLS
RANDOMIZE TIMER
n = 8
DIM a(n)
FOR i = 1 TO n
a(i) = FIX(RND * 900 + 100)
NEXT
PRINT "massiv"
FOR i = 1 TO n
PRINT a(i);
NEXT
FOR i = 1 TO n
FOR j = 2 TO n
IF a(j) > a(j - 1) THEN SWAP a(j), a(j - 1)
NEXT
NEXT
PRINT
PRINT a(5)
Тестирование выполнено в программе QB64 ( Скачать )