SHARE
TWEET

AppendArrays

a guest Oct 23rd, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace AppendArrays
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             List<string> numbers = Console.ReadLine()
  12.              .Split('|')
  13.              .Reverse()
  14.              .ToList();
  15.             List<int> newNumbers = new List<int>();
  16.  
  17.            foreach (string element in numbers)
  18.             {
  19.                 newNumbers.AddRange(element.Split(" ", StringSplitOptions.RemoveEmptyEntries)
  20.                 .Select(int.Parse)
  21.                 .ToList()
  22.                 );
  23.             }
  24.             Console.Write(string.Join(' ', newNumbers));
  25.         }
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top