遍历三维数组中的项

 1 int[,,] arr=new int[3,3,3];          
 2 
 3             for (int i = 0; i < 3; i++)
 4               for (int j=0;j<3;j++)
 5                 for (int k=0;k<3;k++)
 6             {
 7                 Random ran = new Random();
 8                 arr[i, j, k] = ran.Next(0, 100);
 9                 Thread.Sleep(10);
10             }
11             for (int i=0;i<3;i++)
12                 for (int j=0;j<3;j++)
13                      for (int k=0;k<3;k++)
14                      {
15                          Console.Write("  " +arr[i,j,k]);
16                          if (k == 2)
17                              Console.Write("
");
18                       }
19             Console.Read();
原文地址:https://www.cnblogs.com/ck235/p/4718863.html