Advertisement
gabi11

Sets & Dictionaries Advanced - 01. Unique Usernames

May 19th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Text.RegularExpressions;
  7.  
  8. namespace Advanced
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             var usernames = new HashSet<string>();
  15.  
  16.             int number = int.Parse(Console.ReadLine());
  17.  
  18.             for (int i = 0; i < number; i++)
  19.             {
  20.                 var input = Console.ReadLine();
  21.  
  22.                 usernames.Add(input);
  23.             }
  24.  
  25.             foreach (var name in usernames)
  26.             {
  27.                 Console.WriteLine(name);
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement