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