using System;
public class ExempleTab2Dimension
{
public static void Main()
{
int[,,] matrice = new int[3, 3, 3];
int somme = 0;
int n = 1;
for(int x=0; x < 3; x++)
{
for(int y=0; y < 3; y++)
{
for(int z=0; z < 3; z++)
{
matrice[x, y, z] = n++;
}
}
}
somme = matrice[0,0,0] + matrice[1,1,1] + matrice[2, 2, 2];
Console.WriteLine("La somme de la première diagonale: " + somme);
}
}