#include <iostream>
using namespace std;
const int MAX_FILAS = 3; // Puedes ajustar el tamaño según tus necesidades
void llenarMatrizTriangularSuperior(int matriz[MAX_FILAS][MAX_FILAS]) { cout << "Ingrese los elementos de la matriz triangular superior:" << endl;
for (int i = 0; i < MAX_FILAS; i++) { for (int j = i; j < MAX_FILAS; j++) { cin >> matriz[i][j];
}
}
}
void mostrarMatrizTriangularSuperior(int matriz[MAX_FILAS][MAX_FILAS]) { cout << "Matriz triangular superior:" << endl;
for (int i = 0; i < MAX_FILAS; i++) { for (int j = 0; j < MAX_FILAS; j++) { if (j >= i) { cout << matriz[i][j] << " ";
} else { cout << "0 ";
}
}
cout << endl;
}
}
int main() { int matrizTriangularSuperior[MAX_FILAS][MAX_FILAS];
llenarMatrizTriangularSuperior(matrizTriangularSuperior);
mostrarMatrizTriangularSuperior(matrizTriangularSuperior);
return 0;
}