string[,,] arr3 = new string[2, 2,1];
        arr3[0, 0,0] = "cngothic0-0-0";
        arr3[0, 1, 0] = "cngothic0-1-0";
        arr3[1, 0, 0] = "cngothic1-1-0";
        arr3[1, 1, 0] = "cngothic1-1-0";至少是三维数组。如果利用FOR 循环来输出尼。

解决方案 »

  1.   

    foreach( string[][] array2 in array3 ){
      foreach( string[] array1 in array2){
        foreach( string s in array1){
           /* 处理s */
        }
      }
    }for( index i3 = 0; i3 < array3.Length; i3 ++ ){
       for( index i2 = 0; i2 < array3[0].Length; i2 ++ ){
          for( index i1 = 0; i1 < array3[0][0].Length; i1 ++ ){
            /* 处理 array3[i3,i2,i1] */
    }
      

  2.   

    如果是单纯的输出:
    int[,] tt = { { 1, 2 }, { 3, 4 }, { 5, 6 } };
                foreach (int i in tt)
                {
                    Console.WriteLine(i.ToString());
                }如果向想用For输出就呆坐三次循环..
      

  3.   

    int[,] tt = { { 1, 2 }, { 3, 4 }, { 5, 6 } };
                foreach (int i in tt)
                {
                    Console.WriteLine(i.ToString());
                }
      

  4.   

    汗。乱乱的啊。。我看到一个代码是输出2维数组的for循环了两次。        for (int i = 0; i < arr2.Rank; i++)
            {
                for (int j = 0; j <= arr2.GetUpperBound(arr2.Rank - 1); j++)
                {                Response.Write(arr2[i, j].ToString() + "<br>");
                }
            }
      

  5.   

    LZ 为什么要有这样的应用??这是何等的........你计算一下程序运行时间吧 o(N)
      

  6.   

            string[,,] arr3 = new string[2, 2,1];
            arr3[0, 0,0] = "cngothic0-0-0";
            arr3[0, 1, 0] = "cngothic0-1-0";
            arr3[1, 0, 0] = "cngothic1-1-0";
            arr3[1, 1, 0] = "cngothic1-1-0";希望朋友给以上面的数组写个输出例子。谢谢。
      

  7.   

    我没础差啊。谁给我写个完整的可以直接调试的。HELP!
      

  8.   


    string[, ,] arr3 = new string[2, 2, 1];
                arr3[0, 0, 0] = "cngothic0-0-0";
                arr3[0, 1, 0] = "cngothic0-1-0";
                arr3[1, 0, 0] = "cngothic1-1-0";
                arr3[1, 1, 0] = "cngothic1-1-0";            for (int i = 0; i < 2; i++)
                    for (int j = 0; j < 2; j++)
                        for (int k = 0; k < 1; k++)
                            if (arr3[i, j, k] != null)
                                Console.WriteLine("arr3[{0},{1},{2}]={3}", i, j, k, arr3[i, j, k]);
      

  9.   

    哎是我表达不清楚吧。
            string[,,] arr3 = new string[2, 2,1]; 
            arr3[0, 0,0] = "cngothic0-0-0"; 
            arr3[0, 1, 0] = "cngothic0-1-0"; 
            arr3[1, 0, 0] = "cngothic1-1-0"; 
            arr3[1, 1, 0] = "cngothic1-1-0"; 
    上面的三个维数上限已经定好了。
    在不知道三维数上限的情况如何写啊。
      

  10.   

    如果只是要遍历输出的话可以这么实现:
    IEnumerator ie = arr3.GetEnumerator();
    while(ie.MoveNext())
    {
        if(ie!=null)
            Console.WriteLine(ie.Current.ToString());
    }