public static void main(String[] args){
int arr[] = {10, 1, 9, 3, 5, 6, 2};
int temp[] = new int[arr.length];
int count = 0;
for(int i = 1; i <arr.length; i++){
if(arr[i] > arr[i-1]){
temp[count] = arr[i];
count++;
}
}
System.out.println("Arreglo origen");
for(int o=0; o < arr.length; o++){
System.out.println(arr[o]);
}
System.out.println("Arreglo final");