Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- class Program
- {
- static void Main(string[] args)
- {
- string line = "";
- bool first = true;
- while ((line = Console.ReadLine()) != "0")
- {
- int n = int.Parse(line);
- List<string> Print = new List<string>();
- for (int i = 0; i < n; i++)
- {
- Print.Add(Console.ReadLine());
- };
- var sorted = Print.OrderBy(x => x.Remove(Math.Min(x.Length, 2)));
- if (!first)
- {
- Console.WriteLine();
- }
- first = false;
- foreach (string name in sorted)
- {
- Console.WriteLine(name);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement