CLS
n = 5
DIM a$(n), b(26), c(n)
FOR i = 1 TO n
INPUT "vvedite slovo"; a$(i)
a$(i) = LCASE$(a$(i))
NEXT
u$ = "abcdefghijklmnopqrstuvwxyz"
FOR i = 1 TO n
FOR j = 1 TO 26
IF MID$(a$(i), 1, 1) = MID$(u$, j, 1) THEN c(i) = j
NEXT
NEXT
FOR i = 1 TO n
FOR j = 2 TO n
IF c(j) < c(j - 1) THEN SWAP c(j), c(j - 1): SWAP a$(j), a$(j - 1)
NEXT
NEXT
FOR i = 1 TO n
PRINT a$(i)
NEXT
Тестирование выполнено в программе QB64 ( Скачать )