Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Append_Lists
- {
- class Append_Lists
- {
- static void Main(string[] args)
- {
- List<string> items = Console.ReadLine().Split('|').ToList();
- items.Reverse();
- var result = new List<string>();
- foreach (var item in items)
- {
- List<string> nums = item.Split(' ').ToList();
- foreach (var num in nums)
- {
- if (num != "") result.Add(num);
- }
- }
- Console.WriteLine(string.Join(" ", result));
- }
- }
- }
Add Comment
Please, Sign In to add comment