#include
using namespace std;
long Factorial(int num)
{
long res = 1;
for (int i = num; i > 1; i--)
res *= i;
return res;
}
int NumOfElements(int **matrix, int mSize, int nSize)
{
int res = 0;
for (int i = 0; i < mSize; i++)
{
for (int j = 0; j < nSize; j++)
if (matrix[i][j] % 2 == 0 && matrix[i][j] < 0)
res++;
}
return res;
}
int main()
{
int
num,
**matrix,
mSize,
nSize;
cout << "Input a number: ";<br> cin >> num;
cout << num << "! = " << Factorial(num) << endl;<br>
cout << "Input a matrix size: ";<br> cin >> mSize >> nSize;
matrix = new int*[mSize];
for (int i = 0; i < mSize; i++)
matrix[i] = new int[nSize];
for (int i = 0; i < mSize; i++)
for (int j = 0; j < nSize; j++)
cin >> matrix[i][j];
cout << "Num. of the elements = " << NumOfElements(matrix, mSize, nSize) << endl;<br>
system("pause");
return 0;
} /* End of the 'main' function */