标签:out temp sys i+1 for bsp static oid nbsp
冒泡排序
public class BubleSort {
public static void Sort(int[] array){
for(int i=0;i<array.length;i++){
for(int j=i+1;j<array.length;j++){
if(array[i]>array[j]){
int temp=array[i];
array[i]=array[j];
array[j]=temp;
}
}
}
}
public static void main(){
int array[]={5, 69, 12, 3, 56, 789, 2, 5648, 23};
Sort(array);
for(int i:array){
System.out.printf("\t"+i);
}
}
}
标签:out temp sys i+1 for bsp static oid nbsp
原文地址:http://www.cnblogs.com/styz/p/7782647.html