Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 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 _02AppendLists
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. List<string> input = Console.ReadLine()
  14. .Split('|')
  15. .ToList();
  16. List<int> result = new List<int>();
  17.  
  18. for (int i = input.Count - 1; i >= 0; i--)
  19. {
  20. result.AddRange(input[i]
  21. //.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries)
  22. .Split().Where(x => !string.IsNullOrEmpty(x))
  23. .Select(int.Parse)
  24. .ToList());
  25. }
  26.  
  27. Console.WriteLine(string.Join(" ", result));
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement