Gyoshev

`Fix emails new

May 29th, 2017
132
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.  
  4. namespace P8_HandsOfCards
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. var input = Console.ReadLine();
  11. var people = new Dictionary<string, string>();
  12.  
  13. while (input != "stop")
  14. {
  15. var email = Console.ReadLine();
  16.  
  17. if (!email.EndsWith("us", StringComparison.OrdinalIgnoreCase) && !email.EndsWith("uk", StringComparison.OrdinalIgnoreCase))
  18. {
  19. people.Add(input, email);
  20. }
  21.  
  22. input = Console.ReadLine();
  23. }
  24.  
  25. foreach (var person in people)
  26. {
  27. Console.WriteLine($"{person.Key} -> {person.Value}");
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment