// 冒泡排序
for (int i = 0; i<arr.count; i++) {
for (int j = 0; j<arr.count - 1; j++) {
if (arr[j] > arr[j+1]) {
NSNumber *x = arr[j];
arr[j] = arr[j+1];
arr[j+1] = x;
}
}
}
image.png
网友评论