Advertisement
mdamyanova

FixEmails

May 29th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace _07.FixEmails
  5. {
  6.     public class FixEmails
  7.     {
  8.         public static void Main()
  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") && !email.EndsWith("uk"))
  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
Advertisement