标签:style http color ar for div sp ef c
public static void main(String[] args) { //System.out.println("Hello World!"); int[] arr = { 8, 1, 2, 7, 4, 6, 12, 88, 95, 45, 32, 56 }; SelectSort(arr); PrintArr(arr); } public static void SelectSort(int[] arr) { for (int x = 0; x < arr.length; x++) { for (int y = x + 1; y < arr.length; y++) { if (arr[x] > arr[y]) { int temp = arr[y]; arr[y] = arr[x]; arr[x] = temp; } } } } public static void PrintArr(int[] arr) { System.out.print("["); for(int i=0;i<arr.length;i++) { if(i!=arr.length-1) { System.out.print(arr[i]+", "); } else { System.out.print(arr[i]+"]"); } } } }
标签:style http color ar for div sp ef c
原文地址:http://www.cnblogs.com/xiaoyongit520/p/3941373.html