package Paixu;
public class Zhijie {
public static void main(String args[]) {
int a[] = {3,1,5,7,2,4,9,6};
Zhijie b=new Zhijie(a);
}
public Zhijie(int[] a){
int n=a.length;
int temp;
for(int i=0;i<n;i++) {
int j=i-1;
temp=a[i];
for(;j>=0&&temp<a[j];j--) {
a[j+1]=a[j];
}
a[j+1]=temp;
}
for(int i=0;i<a.length;i++) {
System.out.println(a[i]);
}
}
}
09-03