第1个回答 2012-07-18
如果是foreach的话,是一行一行输出
如下
int[,] numbers2D = new int[3, 2] { { 9, 99 }, { 3, 33 }, { 5, 55 } };
foreach (int i in numbers2D)
{
System.Console.Write("{0} ", i);
}
// Output: 9 99 3 33 5 55
第3个回答 2012-07-18
int[,] array = new int[4, 5];
for (int i = 0; i < array.GetLength(0); i++)
{
for (int j = 0; j < array.GetLength(1); j++)
{
Console.WriteLine("{0}\t", array[i, j]);
}
Console.WriteLine();
}