struct node
{
char str[
22];
int num;
int score;
}stu[N];
bool cmp(
const node &a,
const node &
b)
{
if(a.score ==
b.score)
return strcmp(a.str, b.str) <
0 ?
1 :
0;
//按字典序升序
else
return a.score >
b.score;
}
sort(stu , stu + N,
cmp);
转载于:https://www.cnblogs.com/wwjyt/p/3178672.html
转载请注明原文地址: https://win8.8miu.com/read-48345.html