Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication13
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. var input = Console.ReadLine().Split(new char[] { ' ', '=', '>' }, StringSplitOptions.RemoveEmptyEntries).ToList();
  15. var dict1 = new Dictionary<string, string>();
  16. while (input[0] != "lambada")
  17. {
  18. if (input[0] == "dance")
  19. {
  20. for (int i = 0; i < dict1.Count; i++)
  21. {
  22. var item = dict1.ElementAt(i);
  23. var list2 = item.Value.Split('.').ToList();
  24. dict1[item.Key] = list2[0] + "." + item.Value;
  25. }
  26. }
  27. else
  28. {
  29. dict1[input[0]] = input[1];
  30. }
  31. input = Console.ReadLine().Split(new char[] { ' ', '=', '>' }, StringSplitOptions.RemoveEmptyEntries).ToList();
  32. }
  33. foreach (var item in dict1)
  34. {
  35. Console.WriteLine(item.Key + " => " + item.Value);
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement