Advertisement
Guest User

Untitled

a guest
Mar 4th, 2017
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _6.Stuck_Zipper
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. List < int > list = Console.ReadLine().Split(new char[] { },StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
  14. List<int> list1 = Console.ReadLine().Split(new char[] { }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
  15.  
  16. for (int i = 0; i < list.Count; i++)
  17. {
  18. if (list[i] >= 10)
  19. {
  20. list.RemoveAt(i);
  21. i--;
  22. }
  23. }
  24. for (int i = 0; i < list1.Count; i++)
  25. {
  26. if (list1[i] >= 10)
  27. {
  28. list1.RemoveAt(i);
  29. i--;
  30. }
  31. }
  32. for (int i = 1,j=0; i < list.Count+list1.Count; i+=2,j++)
  33. {
  34. if (j >= list.Count)
  35. {
  36. break;
  37. }
  38. if (i>list1.Count)
  39. {
  40. i--;
  41. }
  42. list1.Insert(i, list[j]);
  43. }
  44. Console.WriteLine(String.Join(" ",list1));
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement