您的位置:首页 > 其它

遍历三维数组

2015-08-10 20:59 169 查看
using System;
using System.Collections.Generic;
using System.Text;

namespace 遍历三维数组
{
class Program
{
static void Main(string[] args)
{

int[, ,] szA = new int[2,3,4]{
{{0,1,2,3},
{4,5,6,7},
{8,9,10,11}},
{{12,13,14,15},
{16,17,18,19},
{20,21,22,23}}
};

for (int x = 0; x <2; x++)

for (int y = 0; y < 3; y++)

for (int z = 0; z < 4; z++)
{
Console.WriteLine("数组=" + szA[x, y,z]);

}

//foreach(int i in szA)

Console.ReadLine();

}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: