CLS
RANDOMIZE TIMER
INPUT "vvedite n"; n
DIM a(n)
FOR i = 1 TO n
a(i) = FIX(RND * 90 + 10)
NEXT
FOR i = 1 TO n
PRINT a(i);
NEXT
max = a(1)
FOR i = 1 TO n
IF a(i) > max THEN max = a(i): k = i
NEXT
SWAP a(1), a(k)
PRINT
FOR i = 1 TO n
PRINT a(i);
NEXT
Тестирование выполнено в программе QB64 ( Скачать )