标签:style blog color ar java for sp div c
java实现
package sort; public class SwapSort { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int[] arr={70,80,31,37,10,1,48,60,33,80}; swaptSort(arr); for(int i=0; i<arr.length; i++) System.out.print(arr[i]+" "); } private static void swaptSort(int[] arr) { // TODO Auto-generated method stub int i,j; int temp; for(i=1; i<arr.length; i++) { for(j=0; j<i; j++) { if(arr[i]<arr[j]) { temp=arr[i]; arr[i]=arr[j]; arr[j]=temp; } } } } }
标签:style blog color ar java for sp div c
原文地址:http://www.cnblogs.com/huangcongcong/p/4004158.html