Red de conocimiento informático - Problemas con los teléfonos móviles - Programación Yd

Programación Yd

Asignación de clase pública 3

{

Public static void main(String[] args)

{

int oldArr[]={ 1, 3, 4, 5, 0, 0, 6, 6, 0, 5, 4, 7, 6, 7, 0, 5};

for(int I = 0; i<oldArr .lengthi++ )

{

int c = 0;

if ((oldArr[i]-0)==0)

{

c++;

}

Otros

{

int new arr[]= new int [oldarr . longitud-c];

for(int j = 0; j & ltoldArr.lengthj++)

{

nuevo arreglo[j]= antiguo arreglo[. I]; //Pague el valor distinto de cero de la matriz anterior a la nueva matriz newArr.

}

System.out.print(newArr[i]+",");

}

}

}

}