Created
September 27, 2021 10:41
-
-
Save Ana19997/b9b1ee8eea95bed10cbd94740b89af18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApp11 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int[] array = new int[30]; | |
Random random = new Random(); | |
for (int i = 0; i < array.Length; i++) | |
{ | |
array[i] = random.Next(30); | |
Console.WriteLine(array[i]); | |
} | |
for (int i = 1; i < array.Length - 1; ++i) | |
{ | |
if (array[i - 1] < array[i] && array[i + 1] < array[i]) | |
{ | |
Console.WriteLine("\nЛокальные максимумы " + array[i]); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment