C#如何直接输出一个二维数组。输出语句类似Console.Write(str);str为一个二维字符串数组: string[,] str = new ...

解决方案 »

  1.   


     string[,] myInt=new string [5,10];
                for(int i=myInt.GetLowerBound(0);i<=myInt.GetUpperBound(0);i++)
                {
                    for(int j=myInt.GetLowerBound(1);j<=myInt.GetUpperBound(1);j++)
                   {
                        myInt[i,j]=(i*j).ToString();//赋值
                        Console.WriteLine("第{0}行{1}列:{2}",i,j,myInt[i, j]);//输出
                    }
                }