Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace ZigZag
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int[] firstArr = new int[n];
- int[] secondArr = new int[n];
- for (int i = 0; i < n; i++)
- {
- int[] current = Console.ReadLine().Split(" ").Select(int.Parse).ToArray();
- if (i % 2 == 0)
- {
- firstArr[i] = current[0];
- secondArr[i] = current[1];
- }
- else
- {
- firstArr[i] = current[1];
- secondArr[i] = current[0];
- }
- }
- Console.WriteLine(string.Join(" ",firstArr));
- Console.WriteLine(string.Join(" ", secondArr));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement