2. Word Synonyms, C#, Lab: Associative Arrays
Здравейте, моля за малко помощ за задачата 2. Word Synonyms, гърми ми 4 тест, ще съм благодарна, ако някой ми отговори
Линк към кода ми - https://pastebin.com/qywCPj6i
Условие
Write a program, which keeps a dictionary with synonyms. The key of the dictionary will be the word. The value will be a list of all the synonyms of that word. You will be given a number n – the count of the words. After each word, you will be given a synonym, so the count of lines you have to read from the console is 2 * n. You will be receiving a word and a synonym each on a separate line like this:
- {word}
- {synonym}
If you get the same word twice, just add the new synonym to the list.
Print the words in the following format:
{word} - {synonym1, synonym2… synonymN}
Примери
Input |
Output |
3 cute adorable cute charming smart clever |
cute - adorable, charming smart - clever |
2 task problem task assignment |
task – problem, assignment |
Благодаря!