using System; namespace TestConsole { class Program { static void Main() { int counter = 0; int[] a = new int[10]; Random koreanRandom = new Random(); for(int i = 0; i < a.Length; i++) { a[i] = koreanRandom.Next(1, 20 + 1); //От одного до двадцати Console.Write(a[i] + " "); } Console.WriteLine(); for(int i = 1; i < a.Length - 1; i++) { if(a[i] > a[i - 1] && a[i] > a[i + 1]) { counter++; } } Console.WriteLine(counter + " элементов"); Console.ReadKey(); } } }