Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Short_Words_Sorted
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<string> text = Console.ReadLine().ToLower().Split( new char[] { ' ', '.', ',', ':', ';', '(', ')', '[', ']', '\"', '\'', '\\', '/', '!', '?' },
- StringSplitOptions.RemoveEmptyEntries).ToList();
- var resultWords = text.Where(x => x.Length < 5).OrderBy(x => x).Distinct().ToList();
- Console.WriteLine(string.Join(", ",resultWords));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement