题目
分析
本题的着重点是结构体的排序。一般而言,这类多字段排序需要自定义排序函数,其一般形式如下:
bool cmp(const Student& a, const Student& b)
{
if (a.total != b.total)
{
return a.total > b.total;
}
else if (a.chinese != b.chinese)
{
return a.chinese > b.chinese;
}
else
{
return a.id < b.id;
}
}
答案

思考
(略)
