public class MyArrays {
/**
*升序方法练习
*/
public static int[] sortArray(int[] arr){
for (int i = 0; i < arr.length - 1; i++) {
for (int j = i + 1; j < arr.length ; j++) {
if(arr > arr[j]){
int temp = arr;
arr = arr[j];
arr[j] = temp;
}
}
}
return arr;
}
|
|