Last active
May 17, 2023 07:17
-
-
Save Strelok78/8dd5161982dc2ba7e0c08ee202567a0b to your computer and use it in GitHub Desktop.
Accepts a word from the user and outputs its meaning. If there is no such word, it displays the corresponding message.
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
internal class Program | |
{ | |
public static void Main() | |
{ | |
string enteredText; | |
string returnedValue; | |
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>(); | |
keyValuePairs.Add("aaa", "sss"); | |
keyValuePairs.Add("bbb", "rrr"); | |
keyValuePairs.Add("GDev", "Game Developer"); | |
keyValuePairs.Add("GD", "Game Designer"); | |
enteredText= Console.ReadLine(); | |
if (keyValuePairs.TryGetValue(enteredText, out returnedValue)) | |
Console.WriteLine(returnedValue); | |
else | |
Console.WriteLine("Error"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment