Initialisation d’un tableau à plusieurs dimensions

Author:

ArrayList, Array, HashTable, BitArray
{filelink=18432}

using System;

public class InitialisationMultiDimens
{
    public static void Main()
    {
        int[,] matrice = { {1, 1}, {2, 2}, {3, 5}, {4, 5}, {134, 44} };

        for (int i = 0; i < matrice.GetLength(0); i++)
        {
            for (int j = 0; j < matrice.GetLength(1); j++)
            {
                Console.WriteLine("matrice[{0}, {1}] = {2}", i, j, matrice[i, j]);
            }
        }
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *