要把结构体数组按分数从高到低排,比较函数应该写成( )。
- 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; }