How do I make this program organize the data in it Array
so that the numbers greater than 0 are first and then the zeros in the method Ordenar()
? For example:
Entry
(2,3,0,1,0)
Departure
(2,3,1,0,0)
Here I post the code I have
Scanner leer=new Scanner(System.in);
for(i=0;i<a.length;i++){
System.out.print("ingrese posicion["+i+"]=");
a[i]=leer.nextInt();
}
Ordenar();
}//main
static public void Ordenar(){
//Código que necesito
}