标签:str sys lag tostring als int ring array 冒泡排序
boolean flag = false;
int arr [] = {2,4,5,3,1,6,8,9,7};
for (int i = 0; !flag && i < arr.length - 1; i++ ){
flag = true;
for (int j = 0; j < arr.length - 1; j++){
if (arr[j] > arr[j + 1]){
int temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
flag = false;
}
}
}
System.out.println(Arrays.toString(arr))
标签:str sys lag tostring als int ring array 冒泡排序
原文地址:http://www.cnblogs.com/mv-sky/p/7185947.html