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