二维数组

            int[] shuzu = new int[3] { 3, 5, 7 };

            int[,] arr = new int[2, 3]; 
            {
                {1;3;5}; //[0,0]   [0,1]  [0,2]
                {2;4;6}  //[1,0]   [1,1]  [1,2]
            }
            arr[11]=15;
            Console.Write(arr[1,1]);

            foreach (var a in arr)
    {
        Console.WriteLine(a); 
    }


            for (int i = 0; i <2; i++)//二维
            {
             for (int j = 0; j <3; j++)//一维
            {
             Console.WriteLine(arr[i,j]+"  ");
            }
            }

 

posted @ 2016-04-05 10:28  凌零聆  阅读(137)  评论(0编辑  收藏  举报