Advertisement
Guest User

Untitled

a guest
Feb 1st, 2017
681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 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 AppendLists
  8. {
  9.     class AppendLists
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var input = Console.ReadLine().Split('|').ToArray();
  14.             var result = new List<string>();
  15.             Array.Reverse(input);
  16.             foreach (var token in input)
  17.             {
  18.                 string[] numbers = token.Split(' ');
  19.                 foreach (var item in numbers)
  20.                 {
  21.  
  22.                     if (item != " ")
  23.                     {
  24.                         result.Add(item);
  25.                     }
  26.                 }
  27.             }
  28.             Console.WriteLine(string.Join(" ", result));
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement