标签:img void import highlight array system for inf image
1. 冒泡排序


import java.util.Arrays;
public class BubbleSort {
public static void main(String[] args) {
int[] ary={16,76,23,1,49,15,2};
sort(ary);
System.out.println(Arrays.toString(ary));
}
public static void sort(int[] ary1) {
for (int i = 0; i < ary1.length - 1; i++) {
for (int j = 0; j < ary1.length - i - 1; j++) {
if (ary1[i] > ary1[j]) {
int t = ary1[i];
ary1[i] = ary1[j];
ary1[j] = t;
}
}
}
}
}
标签:img void import highlight array system for inf image
原文地址:https://www.cnblogs.com/satisfysmy/p/8979532.html