koksibg

Append_Lists

Oct 4th, 2016
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 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 Append_Lists
  8. {
  9. class Append_Lists
  10. {
  11. static void Main(string[] args)
  12. {
  13. List<string> items = Console.ReadLine().Split('|').ToList();
  14. items.Reverse();
  15. var result = new List<string>();
  16. foreach (var item in items)
  17. {
  18. List<string> nums = item.Split(' ').ToList();
  19. foreach (var num in nums)
  20. {
  21. if (num != "") result.Add(num);
  22. }
  23. }
  24. Console.WriteLine(string.Join(" ", result));
  25. }
  26. }
  27. }
Add Comment
Please, Sign In to add comment