Advertisement
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 ConsoleApplication13
- {
- class Program
- {
- static void Main(string[] args)
- {
- var input = Console.ReadLine().Split(new char[] { ' ', '=', '>' }, StringSplitOptions.RemoveEmptyEntries).ToList();
- var dict1 = new Dictionary<string, string>();
- while (input[0] != "lambada")
- {
- if (input[0] == "dance")
- {
- for (int i = 0; i < dict1.Count; i++)
- {
- var item = dict1.ElementAt(i);
- var list2 = item.Value.Split('.').ToList();
- dict1[item.Key] = list2[0] + "." + item.Value;
- }
- }
- else
- {
- dict1[input[0]] = input[1];
- }
- input = Console.ReadLine().Split(new char[] { ' ', '=', '>' }, StringSplitOptions.RemoveEmptyEntries).ToList();
- }
- foreach (var item in dict1)
- {
- Console.WriteLine(item.Key + " => " + item.Value);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement