Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace UniqueUsernames
- {
- using System;
- using System.Collections.Generic;
- public class UniqueUsernames
- {
- public static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- SortedSet<string> names = new SortedSet<string>();
- string username = Console.ReadLine();
- for (int i = 0; i < n; i++)
- {
- names.Add(username);
- username = Console.ReadLine();
- }
- foreach (string name in names)
- {
- Console.WriteLine(name);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment