Отсортировать слова в порядке лексикографического возрастания и в качестве ответа вывести...

0 голосов
101 просмотров

Отсортировать слова в порядке лексикографического возрастания и в качестве ответа вывести слово, находящееся ровно посередине (медиану массива). Количество слов нечетно.
Sam is a multi-file text editor based on structural regular expressions It was originally designed in the early 1980s at Bell Labs by Rob Pike with the help of Ken Thompson and other Unix developers for the Blit windowing terminal running on Unix it was later ported to other systems Sam follows a classical modular Unix aesthetic It is internally simple its power leveraged by the composability of a small command language and extensibility through shell integration


Информатика (131 баллов) | 101 просмотров
Дан 1 ответ
0 голосов
words = input().split()N = len(words)for pos in range(N-1):    for i in range(pos+1, N):        if words[i] < words[pos]:            words[i], words[pos] = words[pos], words[i]
print(words[N//2])

Ответ:
integration;"integration";'integration'
(56 баллов)