VelizarAvramov

02. Append Lists

Dec 2nd, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace _02._Append_Lists
  6. {
  7.     class AppendedLists
  8.     {
  9.         static void Main(string[] args)
  10.         {    
  11.             List<List<string>> outerList = Console.ReadLine()
  12.                 .Split('|')
  13.                 .Reverse()
  14.                 .Select
  15.                 (
  16.                 s => s.Split(new char[] { ' ' },
  17.                 StringSplitOptions.RemoveEmptyEntries).ToList()
  18.                 )
  19.                 .ToList();
  20.  
  21.             foreach (var inerList in outerList)
  22.             {
  23.                 Console.Write(string.Join(" ", inerList) + " ");
  24.             }
  25.             Console.WriteLine();
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment