Advertisement
desislava_topuzakova

01. Unique Usernames

May 25th, 2022
658
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace _01.UniqueUsernames
  5. {
  6.     internal class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int n = int.Parse(Console.ReadLine()); //брой usernames
  11.             HashSet<string> usernames = new HashSet<string>();
  12.  
  13.             for (int i = 1; i <= n; i++)
  14.             {
  15.                 string username = Console.ReadLine();
  16.                 usernames.Add(username);
  17.             }
  18.  
  19.             Console.WriteLine(string.Join(Environment.NewLine, usernames));
  20.         }
  21.     }
  22. }
  23.  
Advertisement
RAW Paste Data Copied
Advertisement