package ch3; public class MaoPao { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int a[] ={12,25,32,13,62,36,98}; int i=0,j=0,k=0; for( i=1;i<a.length;i++) { k =a[i]; for(j=i-1;j>=0&&k<a[j];j--) { a[j+1]=a[j]; } a[j+1]=k; } for(int h:a) { System.out.print(h+"\t"); } } }