Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace JaggedArray
- {
- class Program
- {
- static void Main(string[] args)
- {
- int rows = int.Parse(Console.ReadLine());
- int[][] jaggedArray = new int[rows][];
- for (int row = 0; row < rows; row++)
- {
- int[] currentRow = Console.ReadLine().Split().Select(int.Parse).ToArray();
- jaggedArray[row] = currentRow;
- }
- foreach (int[] currentRow in jaggedArray) // to print the Array
- {
- Console.WriteLine(string.Join(" ",currentRow));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment