int[] array = {2, 3, -5, 7, -2, 4, 6, 8, -1, 10}; // Пример массива целых чисел
long product = 1; foreach (int num in array) { product *= num; }
if (product > 100) { int sumOfPositives = 0; foreach (int num in array) { if (num > 0) { sumOfPositives += num; } } Console.WriteLine($"Произведение элементов больше 100. Сумма положительных элементов: {sumOfPositives}"); } else { int countOfNegatives = 0; foreach (int num in array) { if (num < 0) { countOfNegatives++; } } Console.WriteLine($"Произведение элементов меньше или равно 100. Количество отрицательных элементов: {countOfNegatives}"); } } }