Advertisement
Guest User

Untitled

a guest
Aug 7th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _12GenerateRectangles
  8. {
  9. class GenerateRectangle
  10. {
  11. static void Main(string[] args)
  12. {
  13. char[] separators = ".,:;()[]\"'\\/!? ".ToArray();
  14.  
  15. List<string> words = Console.ReadLine().ToLower().Split(separators).ToList();
  16.  
  17. var shortWords = words.Where(x => x.Length < 5).Where(w => w != "");
  18.  
  19. var ordered = shortWords.OrderBy(x => x).Distinct();
  20.  
  21. Console.WriteLine(string.Join(", ", ordered));
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement