Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace _02StudentsByFirstAndLastName
- {
- public class StudentsByFirstAndLastName
- {
- public static void Main()
- {
- var input = Console.ReadLine();
- while (input != "END")
- {
- var name = input
- .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
- .Aggregate((a, b) => a.CompareTo(b) < 0 ? $"{a} {b}" : null);
- if (name != null) Console.WriteLine(name);
- input = Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment