Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace MergingLists
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> odd = Console.ReadLine().Split().Select(int.Parse).ToList();
- List<int> even = Console.ReadLine().Split().Select(int.Parse).ToList();
- List<int> print = new List<int>();
- for (int i = 0; i < odd.Count + even.Count; i++)
- {
- if (i < odd.Count)
- {
- print.Add(odd[i]);
- }
- if (i < even.Count)
- {
- print.Add(even[i]);
- }
- }
- Console.WriteLine(string.Join(" ", print));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement