Advertisement
gospod1978

List-Ex/Append arrays

Oct 19th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. namespace fundamental
  6. {
  7.     class MainClass
  8.     {
  9.         public static void Main()
  10.         {
  11.            
  12.             List<string> numbers = Console.ReadLine().Split('|', StringSplitOptions.RemoveEmptyEntries).Reverse().ToList();
  13.    
  14.    for (int i = 0; i < numbers.Count; i++)
  15.    {
  16.     List<string> work = numbers[i].Split(" ", StringSplitOptions.RemoveEmptyEntries).ToList();
  17.    
  18.       for (int j = 0; j < work.Count; j++)
  19.          {
  20.           Console.Write($"{work[j]} ");
  21.          }
  22.    }
  23.            
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement