Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace P02_AppendLists
- {
- class P02_AppendLists
- {
- static void Main(string[] args)
- {
- var nums = Console.ReadLine().Split('|').ToList();
- nums.Reverse();
- var textJoin = string.Join("|", nums);
- var resultList = textJoin.Split('|', ' ').ToList();
- var finalList = new List<string>();
- for (int i = 0; i < resultList.Count; i++)
- {
- if (resultList[i] != string.Empty)
- {
- finalList.Add(resultList[i]);
- }
- }
- Console.WriteLine(string.Join(" ", finalList));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement