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 _6.Stuck_Zipper
- {
- class Program
- {
- static void Main(string[] args)
- {
- List < int > list = Console.ReadLine().Split(new char[] { },StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
- List<int> list1 = Console.ReadLine().Split(new char[] { }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
- for (int i = 0; i < list.Count; i++)
- {
- if (list[i] >= 10)
- {
- list.RemoveAt(i);
- i--;
- }
- }
- for (int i = 0; i < list1.Count; i++)
- {
- if (list1[i] >= 10)
- {
- list1.RemoveAt(i);
- i--;
- }
- }
- for (int i = 1,j=0; i < list.Count+list1.Count; i+=2,j++)
- {
- if (j >= list.Count)
- {
- break;
- }
- if (i>list1.Count)
- {
- i--;
- }
- list1.Insert(i, list[j]);
- }
- Console.WriteLine(String.Join(" ",list1));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement