Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- class Program
- {
- static void Main()
- {
- string[] inputArray = Console.ReadLine().Split('|').ToArray();
- List<int> result = new List<int>();
- for (int i = inputArray.Length - 1; i >= 0; i--)
- {
- char[] separators = { ' ' };
- List<int> trimmedNums = inputArray[i]
- .Split(separators, StringSplitOptions.RemoveEmptyEntries)
- .Select(int.Parse)
- .ToList();
- result.AddRange(trimmedNums);
- }
- Console.WriteLine(string.Join(" ", result));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement