-
-
Save cyberlex404/4fb9032cb2a6d04a695a7531a8969d65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stroka = input() # Мы читаем ВСЮ строку в переменную | |
| #stroka = 'bye bye.' | |
| mywords = stroka[0:-1].split() # разделяем split() строку без последнего символа '.' | |
| min = len(mywords[0]) + len(mywords[1]) | |
| res = mywords[0] + ' ' + mywords[1] | |
| for i in range(1, len(mywords)-1): | |
| cur = len(mywords[i]) + len(mywords[i+1]) | |
| if(cur < min): | |
| res = mywords[i] + ' ' + mywords[i+1] | |
| min = cur | |
| print(min) | |
| print(res) | |
| #print('Слова: ', res , '\n\rДлина: ' , min) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment