Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] array = new int[5];
- Console.WriteLine("Заполните массив:");
- for (int i = 0; i < array.Length; i++)
- {
- array[i] = Convert.ToInt32(Console.ReadLine());
- }
- Console.WriteLine("Вы заполнили массив:");
- for (int i = 0; i < array.Length; i++)
- {
- Console.WriteLine(array[i] + " ");
- }
- if (array[0] >= array[1])
- {
- Console.Write(array[0] + " - ЛМ ");
- }
- else
- {
- Console.Write(array[0] + " - Не ЛМ ");
- }
- for (int i = 1; i <= array.Length - 2; i++)
- {
- if (array[i] < array[i - 1] || array[i] < array[i + 1])
- {
- Console.Write(array[i] + " - Не ЛМ ");
- }
- else
- {
- Console.Write(array[i] + " - лм ");
- }
- }
- if (array[array.Length - 1] >= array[array.Length - 2])
- {
- Console.Write(array[array.Length - 1] + " - Лм ");
- }
- else
- {
- Console.Write(array[array.Length-1] + " - не лм ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement