elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


  Mostrar Mensajes
Páginas: [1]
1  Programación / Java / Re: Ordenar array bidimensional en: 1 Abril 2013, 02:36 am
al estar buscando pues mejor me puse hacerlo espero que les ayude
y que me pueda ayudar ayudándolos saludos

public static void main(String seraff[]) {
        String nombre[][] = {{"90", "zavala", "40", "50", "20"},
                             {"10", "juan", "20", "25", "10"},
                             {"90", "blanko", "90", "90", "90"},
                             {"99", "andres", "99", "99", "99"}};
        String aux = "";
      for(byte k=0;k<4;k++){
        for (byte i = 0; i <3; i++) {
                if (nombre[1].compareTo(nombre[i+1][1]) > 0) {
                       for (byte j = 0; j < 5; j++) {
                            aux = nombre[j];
                            nombre[j] = nombre[i + 1][j];
                            nombre[i + 1][j] = aux;
                    }
                }
            }}

        aux="";
        for (byte i = 0; i < 4; i++) {
    for(byte j=0;j<5;j++){
    aux+=nombre[j]+"  ";
    }
           
aux+="\n";
        }
        System.out.println(aux);

    }
}
 


ITM
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines