CLS
n = 14
DIM a(n)
FOR i = 1 TO n
PRINT "vvedite element"; i
INPUT a(i)
NEXT
min = a(1): max = a(1)
FOR i = 1 TO n
IF a(i) >= max THEN max = a(i): k1 = i
IF a(i) <= min THEN min = a(i): k2 = i
NEXT
CLS
PRINT "massiv"
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
PRINT "max ="; max: PRINT "min ="; min
SWAP a(k1), a(k2)
FOR i = 1 TO n
PRINT a(i);
NEXT
Тестирование выполнено в программе QB64 ( Скачать )