#include<bits/stdc++.h>
using namespace std;
/*
3
0
fang 90
yang 50
ning 70
4
1
jack 70
peter 96
Tom 70
smith 67
*/
struct student{
char name[100];
int grade;
};
bool cmp(student a, student b) { //降序
return a.grade > b.grade;
//else return a.name < b.name;
}
bool cmp1(student a, student b) { //升序
return a.grade < b.grade;
//else return a.name < b.name;
}
int main() {
&nb...
登录后发布评论
知道啦
要用stable_sort 稳定排序!