Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace Append_Arrays
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             List<string> arrays = Console.ReadLine().Split("|").ToList();
  12.  
  13.  
  14.             for (int i = 0; i < arrays.Count; i++)
  15.             {
  16.  
  17.                 string[] temp = arrays[i].Split(" ",StringSplitOptions.RemoveEmptyEntries).ToArray();
  18.                 for (int j = 0; j < temp.Length; j++)
  19.                 {
  20.                     temp[j] = temp[j].Trim();
  21.                    
  22.  
  23.                 }
  24.                 arrays[i] = string.Join(" ", temp);
  25.                 arrays[i] = arrays[i].Trim();
  26.  
  27.             }
  28.  
  29.  
  30.             arrays.Reverse();
  31.  
  32.             Console.WriteLine(string.Join(" ", arrays));
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement