namespace demo_array
{
class Program
{
static void Main(string[] args)
{
// Create a three-dimensional array.
int[, ,] 3D = new int[3, 5, 4];
3D[0, 0, 0] = 1;
3D[0, 1, 0] = 2;
3D[0, 2, 0] = 3;
3D[0, 3, 0] = 4;
3D[0, 4, 0] = 5;
3D[1, 1, 1] = 2;
3D[2, 2, 2] = 3;
3D[2, 2, 3] = 4;
// Loop over each dimension's length.
for (int i = 0; i < 3D.GetLength(2); i++)
{
for (int y = 0; y < 3D.GetLength(1); y++)
{
for (int x = 0; x < 3D.GetLength(0); x++)
{
Console.Write(3D[x, y, i]);
}
Console.WriteLine();
}
Console.WriteLine();
Console.ReadKey();
}
}
}
}