第20320题 单选题
选出C语言排行榜元素前移函数中while循环的正确条件

下列函数实现排行榜中单个元素的位置调整(类似插入排序的相邻搬移)。当某玩家分数增加,需将其向前移动时,while循环的条件应为( )。

struct Player{ int score; };
void up(Player players[], int n, int idx){
 Player cur = players[idx];
 int i = idx;
 while( ____________________ ){
  players[i] = players[i-1];
  i--;
 }
 players[i] = cur;
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析