Intialisation d’un tableau à deux dimension

Author:

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

using System; 

public class ExempleCarre {
  public static void Main() {
    int[,] tabCarré = {
      { 1, 1 },
      { 2, 4 },
      { 3, 9 },
      { 4, 16 },
      { 5, 25 },
      { 6, 36 },
      { 7, 49 },
      { 8, 64 },
      { 9, 81 },
      { 10, 100 }
    };
    int i, j;

    Console.WriteLine("Nombre Carré");
    for( i = 0; i < 10; i++) {
      for(j = 0; j < 2; j++)
        Console.Write(tabCarré[i,j] + " ");
      Console.WriteLine();
    }
  }
}

Leave a Reply

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