import java.util.Arrays;
public class hhh {
public static int[] pao(int[] arr) {
for (int i = 0; i < arr.length - 1; i++) {
for (int j = 0; j < arr.length - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
int tmp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = tmp;
}
}
}
return arr;}
public static void main(String[] args){
int a[]={2,1,5,3,4,7,5};
System.out.println(Arrays.toString(pao(a)));
}
}
03-03
477
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-18
1293
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-17
4395
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-14
1218
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)