Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- class JoinLists
- {
- static void Main()
- {
- string firstLine = Console.ReadLine();
- string secondLine = Console.ReadLine();
- string[] firstArray = firstLine.Split(' ');
- string[] secondArray = secondLine.Split(' ');
- List<string> firstList = firstArray.ToList<string>();
- List<string> secondList = secondArray.ToList<string>();
- List<string> joinedLists = firstList.Union(secondList).ToList<string>();
- joinedLists.Sort();
- foreach (var item in joinedLists)
- {
- Console.Write(item + " ");
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement