#include <iostream>
#include <ctime>
#define ROWS 6
#define COLS 4
// Function to print a specific row from the array
void printRow(int arr[ROWS][COLS], int row) {
std::cout << "row : " << row << std::endl;
for (int j = 0; j < COLS; j++) {
std::cout << arr[row][j] << " ";
}
std::cout << std::endl;
}
int main() {
int arr[ROWS][COLS] = {
{1, 3, 5, 0},
{6, 8, 9, 1},
{2, 3, 4, 5},
{0, 6, 7, 9},
{5, 7, 8, 3},
{9, 8, 7, 4}
};
int N = 2;
std::srand(std::time(0));
for (int i = 0; i < N; i++) {
int row = std::rand() % ROWS;
printRow(arr, row);
}
}
/*
run:
row : 3
0 6 7 9
row : 1
6 8 9 1
*/