CLS
N = 80
DIM D(N)
RANDOMIZE TIMER
PRINT "MASSIV: "
FOR I = 1 TO N
D(I) = INT(RND(10) * 10)
PRINT D(I)
NEXT I
MAX = 1
MIN = 1
FOR I = 2 TO N
IF D(I) < D(MIN) THEN MIN = I
IF D(I) > D(MAX) THEN MAX = I
NEXT I
SWAP D(MIN), D(MAX)
PRINT "RESULT: "
FOR I = 1 TO N
PRINT D(I)
NEXT I
Тестирование выполнено в программе QB64 ( Скачать )