На языке c++ (вариант 1)

Приложения:

Ответы

Ответ дал: Milton812
0
#include <iostream>

int main()
{
    const int MATRIX_SIZE = 3;
    int PositiveNumbers = 0;
    int NegativeNumbers = 0;
    int Matrix[MATRIX_SIZE][MATRIX_SIZE] = {
        {-10, 20, 13},
        {-25, 1, 3},
        {4, 12, -8 }
    };
    for(int i=0; i<MATRIX_SIZE; i++)
        for (int j = 0; j < MATRIX_SIZE; j++)
        {
            if (Matrix[i][j] > 0)
                PositiveNumbers++;
            if (Matrix[i][j] < 0)
                NegativeNumbers++;
        }
    std::cout << "Count of positive numbers: " << PositiveNumbers;
    std::cout << "Count of negative numbers:" << NegativeNumbers;
                
}
Вас заинтересует