Created
October 29, 2018 14:32
-
-
Save Retterath/3201e55e89c79ff584d870e36529049b to your computer and use it in GitHub Desktop.
StackOverflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace AppendArrays | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
List<string> numbersAsStrings = Console.ReadLine() | |
.Split('|') | |
.Reverse() | |
.ToList(); | |
List<int> numbers = new List<int>(); | |
foreach (var str in numbersAsStrings) | |
{ | |
numbers.AddRange(str.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries) | |
.Select(int.Parse) | |
.ToList() | |
); | |
// Zapiswam stoinostite ot stariq List w nov List | |
// Smeneni sa oshte gore s .Reverse | |
} | |
Console.WriteLine(string.Join(" ", numbers)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment