Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Diagnostics.CodeAnalysis;
- using System.Linq;
- using System.Numerics;
- namespace SoftuniExercisesWithVariables
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Enter number of lines you want: ");
- int lines = int.Parse(Console.ReadLine());
- int[] arrayOfNums1 = new int[lines];
- int[] arrayOfNums2 = new int[lines];
- int count = 0;
- while(lines>0)
- {
- int[] array = Console.ReadLine().Split(" ").Select(int.Parse).ToArray();
- if(count % 2 == 0)
- {
- arrayOfNums1[count] = array[0];
- arrayOfNums2[count] = array[1];
- }
- else
- {
- arrayOfNums1[count] = array[1];
- arrayOfNums2[count] = array[0];
- }
- lines--;
- count++;
- }
- foreach(int i in arrayOfNums1)
- {
- Console.Write(i + " ");
- }
- Console.WriteLine();
- foreach(int l in arrayOfNums2)
- {
- Console.Write(l + " ");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment