Advertisement
desislava_topuzakova

Сливане на списъци

Jun 7th, 2020
894
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace AlgorithmsOverStructureData
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             List<int> listOfNumbers1 = Console.ReadLine().Split(" ").Select(int.Parse).ToList();
  12.             List<int> listOfNumbers2 = Console.ReadLine().Split(" ").Select(int.Parse).ToList();
  13.  
  14.  
  15.             List<int> result = new List<int>();
  16.             result.AddRange(listOfNumbers1);
  17.             result.AddRange(listOfNumbers2);
  18.             result.Sort();
  19.  
  20.             Console.WriteLine(string.Join(", ", result));
  21.  
  22.  
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement