using System; public class MainClass { static void Main() { int[,] twoDim = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} }; for( int i = twoDim.GetLowerBound(0); i <= twoDim.GetUpperBound(0); ++i ) { for( int j = twoDim.GetLowerBound(1); j <= twoDim.GetUpperBound(1); ++j ) { Console.WriteLine( twoDim[i,j] ); } } } }
1 2 3 4 5 6 7 8 9