mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-12-16 15:44:39 +00:00
12 lines
267 B
C
12 lines
267 B
C
void fun(int a[], int n) {
|
|
for (int i = 0; i < n; i++) {
|
|
for (int j = 0; j < n - i - 1; j++) {
|
|
if (a[j] > a[j + 1]) {
|
|
int t = a[j];
|
|
a[j] = a[j + 1];
|
|
a[j + 1] = t;
|
|
}
|
|
}
|
|
}
|
|
}
|