int数组上的插入排序
import java.util.*; /* N o w J a v a . c o m - 时 代 Java 提供 */ class InsertionSort1 { public static void main(String args[]) { Scanner src = new Scanner(System.in); int n = src.nextInt(); int a[] = new int[n]; for(int i=0;i<a.length;i++) { a[i] = src.nextInt(); } insertion(a); } private static void insertion(int a[]) { int cur = a[a.length-1]; /* 来 自* n o w j a v a . c o m - 时 代 Java */ for(int i=a.length-1;i>0;i--) { if(cur < a[i-1]) { a[i] = a[i-1]; printa(a); } else { a[i] = cur; printa(a); return; } } a[0] = cur; printa(a); } private static