Загрузка данных


int nonNegativeCount = 0;
int nonNegativeSum = 0;
int negativeProduct = 1;
bool hasNegative = false;

foreach (int number in numbers)
{
    if (number >= 0)
    {
        nonNegativeCount++;
        nonNegativeSum += number;
    }
    else
    {
        hasNegative = true;
        negativeProduct *= number;
    }
}

Console.WriteLine($"3) Количество неотрицательных (>=0): {nonNegativeCount}");
Console.WriteLine($"   Сумма неотрицательных: {nonNegativeSum}");
if (hasNegative)
    Console.WriteLine($"   Произведение отрицательных: {negativeProduct}");
else
    Console.WriteLine("   Отрицательных элементов нет");