Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace System
- {
- class Class
- {
- static void Main(string[] args)
- {
- int = arraySize = 30;
- int[] numbers = new int[arraySize];
- int minValueBorder = 0;
- int maxValueBorder = 15;
- Random generator = new Random();
- int lastIndex = numbers.length - 1;
- for (int i = 0; i < array.Length; i++)
- {
- array[i] = generator.Next(minValueBorder, maxValueBorder + 1);
- Console.Write(numbers[i] + " ");
- }
- Console.WriteLine();
- if (numbers[0] > numbers[1])
- Console.Write(numbers[0] + " ");
- for (int j = 1; j < lastIndex; j++)
- {
- if (numbers[j-1] < numbers[j] && numbers[j] > numbers[j+1])
- Console.Write(numbers[j] + " ");
- }
- if (array[lastIndex] > numbers[lastIndex - 1])
- Console.Write(numbers[lastIndex]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement