Ver Mensaje Individual
  #3 (permalink)  
Antiguo 10/02/2014, 13:47
Avatar de Totti7
Totti7
 
Fecha de Ingreso: mayo-2012
Ubicación: barcelona
Mensajes: 28
Antigüedad: 12 años
Puntos: 2
Respuesta: Imprimir solo dos caracteres de una matriz en c

Muchas gracias por tu tan rapida respuesta, entonces entendiendo i completando el codigo seria algo asi no?

Código C:
Ver original
  1. #include <stdio.h>
  2. #include <limits.h>
  3. main()
  4. {
  5.     int m[2][3] = {1,2,3,4,5,6};
  6.     int i, j, min = INT_MAX, max = INT_MIN;
  7.     for (i=0;i<2;i++) {
  8.         for (j=0;j<3;j++)
  9.         {  
  10.             if(m[i][j] < min) {
  11.             min = m[i][j];
  12.             }
  13.             if(m[i][j] > max) {
  14.             max = m[i][j];
  15.             }
  16.             printf(" %d, ",m[max][min]);
  17.         }
  18.     printf("\n");
  19.     }
  20. }
La cuestion es que no funciona del todo bien, en que me e equivocado?