Buscar este blog

jueves, 10 de octubre de 2013

Ordenar arreglo 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: