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

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 @   hofmann  阅读(332)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示