static void Main(string[] args) { DelegateArray[] delArray = new DelegateArray[] { delegate(int x) { x = random.Next(1, 99); return(x); }, (x) => { x = random.Next(1, 99); return(x); }, (x) => { x = random.Next(1, 99); return(x); } }; int sum = 0; for (int i = 0; i < delArray.Length; i++) { sum += delArray[i](Convert.ToInt32(i)); } Console.WriteLine("Проверочное число = " + sum); sum = sum / delArray.Length; Console.WriteLine(sum); }
static void Main(string[] args) { DelegateArray array = new DelegateArray(); array.Print(); Console.ReadKey(); }