INPUT "vvedite kol-vo slov ", n
DIM a$(n)
FOR i = 1 TO n
INPUT "vvedite slovo ", a$(i)
NEXT
min = 1
max = 1
PRINT "ishodnyj massiv"
FOR i = 1 TO n
PRINT a$(i); " ";
NEXT
PRINT
FOR i = 1 TO n
IF LEN(a$(i)) > LEN(a$(max)) THEN max = i
IF LEN(a$(i)) < LEN(a$(min)) THEN min = i
NEXT
SWAP a$(max), a$(min)
PRINT "novyj massiv"
FOR i = 1 TO n
PRINT a$(i); " ";
NEXT
Тестирование выполнено в программе QB64 ( Скачать )