На языке 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;
}
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;
}
Новые вопросы
Английский язык,
2 года назад
Русский язык,
2 года назад
Химия,
8 лет назад
Физика,
8 лет назад
Математика,
9 лет назад