NedyalkoKikov

AppendList

Jun 1st, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 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 AppendList
  8. {
  9. class AppendList
  10. {
  11. static void Main()
  12. {
  13. List<string> items = Console.ReadLine().Split('|').ToList();
  14. items.Reverse();
  15. List<string> result = new List<string>();
  16. foreach(string item in items)
  17. {
  18. List<string> nums = item.Split(new char[] { ' ' },StringSplitOptions.RemoveEmptyEntries).ToList();
  19. result.AddRange(nums);
  20. }
  21. Console.WriteLine(string.Join(" ",result));
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment