Advertisement
svetlyoek

Untitled

Feb 5th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. namespace ConsoleApp154
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int counter = int.Parse(Console.ReadLine());
  10. int[] firstArray = new int[counter];
  11. int[] secondArray = new int[counter];
  12.  
  13. for (int i = 1; i <= counter; i++)
  14. {
  15. int[] array = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  16.  
  17.  
  18. if (i % 2 == 0)
  19. {
  20. firstArray[i] = array[0];
  21. secondArray[i] = array[1];
  22. }
  23. else
  24. {
  25. firstArray[i] = array[1];
  26. secondArray[i] = array[0];
  27. }
  28. }
  29. Console.WriteLine(string.Join(" ",firstArray));
  30. Console.WriteLine(string.Join(" ",secondArray));
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement