‹ 上一题 下一题 ›

g4-06875. 从高到低的 cmp 未做

要把结构体数组按分数从高到低排,比较函数应该写成( )。

  • A. bool cmp(Student a, Student b) { return a.score > b.score; }
  • B. bool cmp(Student a, Student b) { return a.score < b.score; }
  • C. bool cmp(Student a, Student b) { return a.score == b.score; }
  • D. bool cmp(Student a, Student b) { return true; }
未选择
输入
输出

            
答案