Advertisement
martyz

Fix emails

Oct 15th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 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 FixEmails
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string input = Console.ReadLine();
  14.             var dict = new Dictionary<string, string>();
  15.  
  16.             while (input != "stop")
  17.             {
  18.                 dict[input] = Console.ReadLine();
  19.                 input = Console.ReadLine();
  20.             }
  21.            
  22.             Console.WriteLine(String.Join("\n", dict.Select(x => x.Key + " -> " + x.Value)
  23.                 .Where(x => !(new string[] { ".us", ".uk" }
  24.                 .Contains(x.Substring(x.Length - 3))))));
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement