Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace AppendLists_Lab2
- {
- public class AppendLists_Lab2
- {
- public static void Main()
- {
- var input = Console.ReadLine()
- .Split('|')
- .ToList();
- List<string> result = new List<string>();
- List<string> temp = new List<string>();
- for (int i = input.Count - 1; i >= 0; i--)
- {
- temp = new List<string>(input[i].Split(' ').ToList());
- for (int j = 0; j < temp.Count; j++)
- {
- if (temp[j].Length > 0)
- {
- temp.RemoveAt(j);
- }
- }
- result.AddRange(temp);
- }
- foreach (var item in result)
- {
- Console.Write(item + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement