Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 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 test
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Dictionary<string, List<string>> result =
  14. new Dictionary<string, List<string>>();
  15.  
  16. string name = Console.ReadLine();
  17. string city = Console.ReadLine();
  18.  
  19. // add name as a key and city as a value to result
  20. result.Add(name,new List<string>());
  21. result[name].Add(city);
  22.  
  23. foreach (var list in result)
  24. {
  25. foreach (var str in list.Value)
  26. {
  27. Console.WriteLine(str);
  28. }
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement