#include <iostream>
#include <cstdlib>
#include <ctime>
const int FILAS = 3;
const int COLUMNAS = 9;
void generarCarton(int carton[FILAS][COLUMNAS]) {
// Inicializar la semilla para generar números aleatorios
srand(time(0));
// Llenar el cartón con números aleatorios sin duplicados
for (int i = 0; i < FILAS; i++) {
for (int j = 0; j < COLUMNAS; j++) {
int numero;
bool duplicado;
do {
numero = rand() % 75 + 1;
duplicado = false;
// Verificar si el número ya existe en el cartón
for (int k = 0; k < i; k++) {
for (int l = 0; l < COLUMNAS; l++) {
if (carton[k][l] == numero) {
duplicado = true;
break;
}
}
if (duplicado) {
break;
}
}
} while (duplicado);
carton[i][j] = numero;
}
}
}
void imprimirCarton(const int carton[FILAS][COLUMNAS]) {
for (int i = 0; i < FILAS; i++) {
for (int j = 0; j < COLUMNAS; j++) {
std::cout << carton[i][j] << "\t";
}
std::cout << std::endl;
}
}
int main() {
int carton[FILAS][COLUMNAS];
generarCarton(carton);
imprimirCarton(carton);
return 0;
}