Loading...

Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

Vladicha avatar Vladicha 3 Точки

Dictionary 77/100

Здравейте, някой би ли помогнал с тази задача. Времето ми свърши, но искам да разбера къде греша. Стигнах до някъде, но не успявам да изкарам 100/100

https://pastebin.com/kiNqPS0E

Условието:

 

01. Dictionary

Your task is to take every word and insert it into the dictionary with its definition. A word may have one or more definitions. You will receive all the words and definitions, separated by " | ", and each word and its definition will be separated by ": ".

After this you will have to check the words you have in the dictionary. Now you will receive only words, again separated by " | ". For each word you get you will have to print it and all of its definitions, ordered by length of the definition in descending order (if it exists in the dictionary) in the following format:

"{word}:"

" –{definition1}"

" –{definition2}"

" –{definition3}"

. . .

In the end, you will receive one more command, which will be either "End" or "List". If the command is "End", you should break the program. If the command is "List", you should print all of the words, ordered alphabetically, separated by space (" ").

Input

Three strings. The first one will have pairs of words and descriptions, separated by " | " and each word separated from its description by ": ". The second string will have only words, separated by " | ". The third string will be a command – either "End" or "List".

Output

For each word that is called you have to print it with all of its definitions ordered by their length (descending). In the end you have to print all the words, ordered alphabetically, separated by a single space if you have the command "List".  For all of the words you have to print them in the format:

"{word}:"

" –{definition1}"

" –{definition2}"

" –{definition3}"

. . .

Examples

Input

programmer: an animal, which turns coffee into code | developer: a magician

Pesho | Gosho

List

Output

developer programmer

 

Input

tackle: the equipment required for a task or sport | code: write code for a computer program | bit: a small piece, part, or quantity of something | tackle: make determined efforts to deal with a problem | bit: a short time or distance

bit | code | tackle

End

Output

bit

 -a small piece, part, or quantity of something

 -a short time or distance

code

 -write code for a computer program

tackle

 -make determined efforts to deal with a problem

 -the equipment required for a task or sport

Тагове:
1
Fundamentals Module 04/12/2022 14:10:23
Dikasue avatar Dikasue 0 Точки

Where do you refer these codes, I would love to read more about it.

dynamons world

-2
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.