Skip to content

Instantly share code, notes, and snippets.

@Retterath
Created October 29, 2018 14:32
Show Gist options
  • Save Retterath/3201e55e89c79ff584d870e36529049b to your computer and use it in GitHub Desktop.
Save Retterath/3201e55e89c79ff584d870e36529049b to your computer and use it in GitHub Desktop.
StackOverflow
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