diff --git a/codes/taoreset/.keep b/codes/taoreset/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/codes/taoreset/2349.java b/codes/taoreset/2349.java new file mode 100644 index 0000000000000000000000000000000000000000..83497d9a50b2195c0f83f28598452b59573c98ad --- /dev/null +++ b/codes/taoreset/2349.java @@ -0,0 +1,18 @@ +/** + * 冒泡 排序 函数 + * aa bb cc + * @param a 待排序的数组 + * @param n 待排序的数组长度 + */ +public static void bubbleSort(int [] a, int n){ + // 你的代码,使无序数组 a 变得有序 + for (int i = 0; i < n; i++) { + for (int j = 0; j < i; j++) { + if (a[i] < a[j]) { + int t = a[i]; + a[i] = a[j]; + a[j] = t; + } + } + } +}//end \ No newline at end of file