using System;
class Program
{
static void Main()
{
int[][] jaggedArray = new int[5][];
jaggedArray[0] = new int[6] { 1, 2, 3, 4, 5, 6 };
jaggedArray[1] = new int[3] { 1, 2, 3 };
jaggedArray[2] = new int[5] { 1, 2, 3, 4, 5 };
jaggedArray[3] = new int[10] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
jaggedArray[4] = new int[1] { 1 };
foreach (int[] elementArray in jaggedArray)
{
foreach (int i in elementArray)
{
Console.Write(i + "\t");
}
Console.WriteLine("\n");
}
}
}
class Program
{
static void Main()
{
int[][] jaggedArray = new int[5][];
jaggedArray[0] = new int[6] { 1, 2, 3, 4, 5, 6 };
jaggedArray[1] = new int[3] { 1, 2, 3 };
jaggedArray[2] = new int[5] { 1, 2, 3, 4, 5 };
jaggedArray[3] = new int[10] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
jaggedArray[4] = new int[1] { 1 };
foreach (int[] elementArray in jaggedArray)
{
foreach (int i in elementArray)
{
Console.Write(i + "\t");
}
Console.WriteLine("\n");
}
}
}
No comments:
Post a Comment