// 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; class MainClass { public static void Main(string[] args) { int[] a = new int[1000]; int[] occ = new int[10]; Random rng = new Random(); for(int i = 0; i < a.Length; i++) { a[i] = rng.Next(0, occ.Length); occ[a[i]]++; } for(int j = 0; j < occ.Length; j++) { Console.WriteLine(j + " " + occ[j]); } } }