kirililchev3

Append Lists - Linq solution

Jun 9th, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace sad
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             Console.WriteLine(string.Join(" ", Console.ReadLine()
  11.                 .Split('|')
  12.                 .Reverse()
  13.                 .Select(s=>string.Join(" ",s.Split(new char[] { ' ' },
  14.                 StringSplitOptions.RemoveEmptyEntries)))));
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment