for (int i = 0; i< size-1 ;i++){
for (int j = i+1 ;j<size;j++){
if (list[i]>list[j]){
int temp ;
temp = list[i];
list[i] = list[j];
list[j] = temp ;
//swap(list[i],list[j]);
}
}
}
}
原文:http://www.cnblogs.com/chump-zwl/p/6953292.html