Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace MultiDictionaries
- {
- class Program
- {
- static void Main()
- {
- Dictionary<string, string> storePairs = new Dictionary<string, string>();
- string[] words = Console.ReadLine().Split(new char[] { ' ', '->' }, StringSplitOptions.RemoveEmptyEntries);
- while(words[0] != "end")
- {
- string keyInput = words[0];
- string valueInput = words[1];
- storePairs.Add(keyInput, valueInput);
- }
- string nullWord = "null";
- string defaultWord = Console.ReadLine();
- foreach (KeyValuePair<string, string> pair in storePairs)
- {
- if (storePairs.ContainsValue(nullWord))
- {
- storePairs[pair.Key] = defaultWord;
- }
- }
- foreach()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment