public static void Main(string[] args){
Console.WriteLine("Сколько элементов вы хотите ввести?");
int N = Convert.ToInt32(Console.ReadLine());
int [] array = new int[N];
Console.WriteLine("Введите число:");
int Input = Convert.ToInt32(Console.ReadLine());
Console.WriteLine($"Сумма всех натуральных чисел: {res}");
if (array[i] < array[minIndex]) {
if (array[i] > array[maxIndex]) {
Console.WriteLine($"Индекс минимального числа - {minIndex}, максимального - {maxIndex}");
if (minIndex < maxIndex){
for(int a = minIndex + 1; a < maxIndex; a++){
result = result * array[a];
for(int a = maxIndex + 1; a < minIndex; a++){
result = result * array[a];
Console.WriteLine($"Произведение всех чисел между мин. и макс. - {result}");