NedyalkoKikov

SortStrings

Jun 3rd, 2016
158
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 Sort
  8. {
  9. class Sort
  10. {
  11. static void Main()
  12. {
  13. List<string> list = new List<string>();
  14. list.Add("pesho");
  15. list.Add("gosho");
  16. list.Add("stamat");
  17. list.Add("prokopii");
  18. list.Add("toshko");
  19. list.Add("unufrii");
  20. list.Add("pes");
  21. list = list.OrderBy(a => a.Length).ThenBy(a => a).ToList();
  22. Console.WriteLine(string.Join(" ",list));
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment