// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class Program { public static void Print(int[][] a) { for(int i = 0; i < a.Length; i++) { for(int j = 0; j < a[i].Length; j++) { Console.Write(" " + a[i][j]); } Console.WriteLine(); } } public static void Print(int[,] a) { for(int i = 0; i < a.GetLength(0); i++) { for(int j = 0; j < a.GetLength(1); j++) { Console.Write(" " + a[i,j]); } Console.WriteLine(); } } public static void Main(string[] args) { int[][] a1 = new int[3][]; a1[0] = new int[1]; a1[1] = new int[2]; a1[2] = new int[3]; Print(a1); int[,] a2 = new int[3,4]; Print(a2); } } }