标签:style blog ar sp java for on div log
1:选择排序
package pack; public class Demo { //选择排序 public static void main(String[] args) { int[] arr = {1,22,32,4,52,61}; int temp; for(int i=0;i<arr.length-1;i++){ for(int j=i+1;j<arr.length;j++){ if(arr[i]>arr[j]){ temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } } } for (int i : arr) { System.out.print(i+","); } } }
标签:style blog ar sp java for on div log
原文地址:http://www.cnblogs.com/wikiki/p/4130989.html