1 Star 0 Fork 2.1K

IT老菜鸟/activity-school

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
15651046.java 555 Bytes
Copy Edit Raw Blame History
小旺 authored 2024-03-25 18:15 . 添加排序代码
/**
* 冒泡排序函数
* 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 < n - i - 1; ++j) {
if(a[j] > a[j + 1]) {
int tmp = a[j];
a[j] = a[j + 1];
a[j + 1] = tmp;
}
}
}
} //end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/it-31i45/activity-school.git
git@gitee.com:it-31i45/activity-school.git
it-31i45
activity-school
activity-school
master

Search

0d507c66 1850385 C8b1a773 1850385