当你的才华不能撑起你的野心时,就是你该选择学习的时候了!

C# 矩阵取值

            int[,] arr02 = new int[,] {
                { 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,1,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,1,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,1,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,1,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,1,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,1,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,1,1,2}
                ,{ 0,0,0,0,0,0,0,0,0,0,0,0,1,1,2}
            };
//16行15列
            var temp02 = arr02[15, 14].ToString();
            var temp03 = arr02[14, 13].ToString();
            var temp04 = arr02[13, 12].ToString();
            var temp05 = arr02[0, 14].ToString();
            var temp06 = arr02[0, 13].ToString();
            var temp07 = arr02[0, 12].ToString();

 

posted @ 2020-10-13 13:51  hofmann  阅读(328)  评论(0编辑  收藏  举报