using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _5_2 { class Program { static void Main(string[] args) { int[] dA; int dB; dA = new int[13]; Random r = new Random(); for (int i = 0; i < 1000; i++) { dB = r.Next(1, 7); dB = dB + r.Next(1, 7); dA[dB]++; } for (int i = 1; i < dA.Length; i++) { Console.WriteLine("第{0}面出现的次数为:{1}",i,dA[i]); } Console.ReadKey(); } } }