标签:
1 using System; 2 using System.Collections.Generic; 3 using System.Text; 4 5 namespace 遍历三维数组 6 { 7 class Program 8 { 9 static void Main(string[] args) 10 { 11 12 13 int[, ,] szA = new int[2,3,4]{ 14 {{0,1,2,3}, 15 {4,5,6,7}, 16 {8,9,10,11}}, 17 {{12,13,14,15}, 18 {16,17,18,19}, 19 {20,21,22,23}} 20 }; 21 22 for (int x = 0; x < szA.Length; x++) 23 24 25 for (int y = 0; y < szA.Length; y++) 26 27 for (int z = 0; z < szA.Length; z++) 28 { 29 Console.WriteLine("数组=" + szA[x, y,z]); 30 31 Console.WriteLine("数组=" + szA[x,z,y]); 32 Console.WriteLine("数组=" + szA[y, z, x]); 33 } 34 35 36 //foreach(int i in szA) 37 38 Console.ReadLine(); 39 40 } 41 } 42 }
标签:
原文地址:http://www.cnblogs.com/zxm1002/p/4719215.html