Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace _8.AppendArrays
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.  
  12.             List<string> numbers = Console.ReadLine().Split('|').ToList();
  13.  
  14.             numbers.Reverse();
  15.  
  16.             numbers.RemoveAll(x => string.IsNullOrEmpty(x));
  17.  
  18.  
  19.             string[] realNumbers = numbers.ToArray();
  20.  
  21.             Console.WriteLine(string.Join(" ", numbers), StringSplitOptions.RemoveEmptyEntries);
  22.  
  23.  
  24.  
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement