文章
16
粉丝
402
获赞
21
访问
157.5k
#include
using namespace std;
struct student {
int p;
int q;
};
bool compare (student x, student y){
if (x.q == y.q) return x.p < y.p;
else return x.q < y.q;
}
int main(){
int n;
cin >> n;
student all[n];
for (int i = 0; i < n; i ++){
cin >> all[i].p;
cin >> all[i].q;
}
sort (all, all + n, compare);
for (i...
登录后发布评论
暂无评论,来抢沙发