标签:text span length 概念 int 理解 选择 ext http
sense:也许只有那些时刻准备着的人,才有资格过得好吧
具体代码:
1 public class ChooseSort { 2 public static void main(String []args){ 3 int array[] = {3,2,41,23,45,56,25,7,32,15}; 4 sort(array); 5 for (int value:array) 6 System.out.print(" "+value); 7 } 8 //排序方式:从小到大 9 public static void sort(int array[]){ 10 int markup=0, 11 temp = 0; 12 for (int outer = 0;outer<array.length;outer++) { 13 markup = outer; 14 for (int inner = outer; inner < array.length; inner++) 15 if (array[inner]<array[markup]) 16 markup=inner; 17 if (markup != outer){ 18 temp = array[outer]; 19 array[outer] = array[markup]; 20 array[markup] = temp; 21 } 22 } 23 } 24 }
运行结果:
标签:text span length 概念 int 理解 选择 ext http
原文地址:http://www.cnblogs.com/CannotInputChinese/p/7854211.html