Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //FUNCION PARA CÁLCULO DE POSICION MÁXIMO DE LOS MÍNIMOS DE CADA FILA
- double MaximoMinor(int filas, int columnas, double Matriz[20][20]){
- int pos_i = 1, pos_j = 7;
- int minimo_fila = 0, candidato_min = 0;
- int maxmin = 0, candidato_maxmin = 0;
- int i = 0, j = 0;
- minimo_fila = Matriz[0][0];
- while(i < filas){
- for(int j=0; j<columnas; j++){
- candidato_min = Matriz[i][j];
- if(minimo_fila > candidato_min){
- minimo_fila = candidato_min;
- }
- candidato_maxmin = minimo_fila;
- }
- if(candidato_maxmin > maxmin){
- maxmin = candidato_maxmin;
- }
- i++;
- }
- i = 0;
- while(i < filas){
- for(int j=0; j<columnas; j++){
- if(Matriz[i][j] == maxmin){
- pos_i = i;
- pos_j = j;
- }
- }
- i++;
- }
- cout << maxmin << "\n";
- cout << pos_i << pos_j;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement