public class HelloWorld {
public static void main(String[] args) {
int[] array={40,20,30,90,60,50,10};
System.out.println("paixu before");
paixu(array);
}
public static void paixu(int[] arr) {
int max = 0;
for (int i = 0; i < arr.length; i++) {
for (int j = i+1; j < arr.length; j++) {
if (arr[i] > arr[j]) {
max = arr[i];
arr[i] = arr[j];
arr[j] = max;
}
}
}
for (int k = 0; k < arr.length; k++) {
System.out.println(arr[k]);
}
}
}