Buscar este blog

jueves, 26 de septiembre de 2013

Ordenar Arreglos de nombres

int m=3;
        String [] nom=new String[m];
        nom[0]="a";
        nom[1]="o";
        nom[2]="e";
        String aux="";
        for(int i=0;i<nom.length;i++){
         aux=nom[i];
         for(int j=0; j<nom.length;j++){
         if(  ( nom[j].compareTo(aux) )> 1 ){
         aux=nom[j];
        nom[j]=nom[i];
        nom[i]=aux;
         }
                    }
       
        }

Ing edwin Barrientos A

No hay comentarios: