Teo_Yanchev

ListsExercise - 7.AppendArrays - C# Fundamentals

Sep 19th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace _7
  6. {
  7. class Program
  8. {
  9. static void Main()
  10. {
  11. List<string> input = Console.ReadLine()
  12. .Split('|', StringSplitOptions.RemoveEmptyEntries)
  13. .ToList();
  14.  
  15. List<string> output = new List<string>();
  16. List<int> numbers = new List<int>();
  17.  
  18. for (int i = input.Count - 1; i >= 0 ; i--)
  19. {
  20. output.AddRange(input[i].Split(' ', StringSplitOptions.RemoveEmptyEntries).ToList());
  21.  
  22. }
  23.  
  24. Console.WriteLine(string.Join(' ', output));
  25. }
  26. }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment