第22487题 单选题
为以下C++冒泡排序代码的横线处选择正确的循环语句,完成对含n个int类型元素的数组的升序排序

在下列C++冒泡排序代码的横线处填写合适的循环语句,完成对包含n个int类型元素的数组array的由小到大排序:

void BubbleSort(int array[], int n) {
    for (int i = n; i >= 2; i--)
        for (___________) // 在此处填入代码
            if (array[j] > array[j + 1]) {
                int t = array[j];
                array[j] = array[j + 1];
                array[j + 1] = t;
            }
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析