CLS
RANDOMIZE TIMER
INPUT "vvedite n"; n
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 "max 1,2:"
PRINT a(1), a(2)
Тестирование выполнено в программе QB64 ( Скачать )