#include <iostream>
using namespace std;
int main()
{
const int N = 5;
const int M = 3;
int matrix[N][M];
for(int i = 0; i < N; i++)
for(int j = 0; j < M; j++)
matrix[i][j] = rand() % 10;
cout << matrix[i][j] << "\t";
}
cout << endl;
int min = matrix[0][1];
if((j + 1) % 2 == 0)
if(matrix[i][j] < min)
min = matrix[i][j];
cout << "\n" << min;
return 0;
#include <iostream>
using namespace std;
int main()
{
const int N = 5;
const int M = 3;
int matrix[N][M];
for(int i = 0; i < N; i++)
{
for(int j = 0; j < M; j++)
{
matrix[i][j] = rand() % 10;
cout << matrix[i][j] << "\t";
}
cout << endl;
}
int min = matrix[0][1];
for(int i = 0; i < N; i++)
{
for(int j = 0; j < M; j++)
if((j + 1) % 2 == 0)
{
if(matrix[i][j] < min)
min = matrix[i][j];
}
}
cout << "\n" << min;
return 0;
}