#include #include #define MaxLin 10 #define MaxTur 5 using namespace std; int main() { // Declaración de la matriz bidimensional int produccion[MaxLin][MaxTur]; int lineas, turnos; cout << "--- PLANIFICACION DE PRODUCCION MULTI-LINEA ---" << endl; do{ cout << "Ingrese la cantidad de lineas de produccion: "; cin >> lineas; }while (lineas<2||lineas>MaxLin); do{ cout << "Ingrese la cantidad de turnos de trabajo: "; cin >> turnos; }while (turnos<2||turnos>MaxTur); // 1. Carga de datos en la matriz cout << endl; cout << "--- Ingreso de Unidades Producidas ---" << endl; for (int i = 0; i < lineas; i++) { for (int j = 0; j < turnos; j++) { cout << "Linea " << (i + 1) << ", Turno " << (j + 1) << ": "; cin >> produccion[i][j]; } } // Variables para hallar la máxima producción int maxProduccion = produccion[0][0]; int lineaMax = 1, turnoMax = 1; // 2. Reporte General de la Matriz y Totales por Línea (Filas) cout << endl; cout << "========================================================" << endl; cout << " MATRIZ DE PRODUCCION DIARIA " << endl; cout << "========================================================" << endl; // Encabezado de columnas cout << setw(10) << "Linea"; for (int j = 0; j < turnos; j++) { cout << setw(10) << "Turno " + to_string(j + 1); } cout << setw(12) << "TOTAL" << endl; for (int i = 0; i < lineas; i++) { int totalLinea = 0; cout << setw(10) << "Linea " + to_string(i + 1); for (int j = 0; j < turnos; j++) { cout << setw(10) << produccion[i][j]; totalLinea += produccion[i][j]; // Suma por fila // Evaluación del pico de producción if (produccion[i][j] > maxProduccion) { maxProduccion = produccion[i][j]; lineaMax = i + 1; turnoMax = j + 1; } } cout << setw(12) << totalLinea << endl; } // 3. Totales por Turno (Suma por Columnas) cout << "--------------------------------------------------------" << endl; cout << setw(10) << "TOTAL"; for (int j = 0; j < turnos; j++) { int totalTurno = 0; for (int i = 0; i < lineas; i++) { totalTurno += produccion[i][j]; // Suma por columna } cout << setw(10) << totalTurno; } cout << endl; // 4. Indicadores clave (KPIs) cout << endl; cout << "--- INDICADORES DESTACADOS ---" << endl; cout << "Pico maximo de produccion: " << maxProduccion << " unidades" << " (Linea " << lineaMax << ", Turno " << turnoMax << ")" << endl; return 0; }