PRew_ @ 2023-12-11 19:16:52
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
struct Student {
string name;
int y, m, d;
bool operator< (const Student& t) const {
if (y != t.y) return y < t.y;
if (m != t.m) return m < t.m;
return d < t.d;
}
};
int main() {
int n;
cin >> n;
Student stu[n];
for (int i = 0; i < n; i++)
cin >> stu[i].name >> stu[i].y >> stu[i].m >> stu[i].d;
sort(stu, stu + n);
for (int i = 0; i < n; i++)
cout << stu[i].name << endl;
}
by Composite_Function @ 2023-12-11 19:21:14
好好好,你要不要看看这是哪道题 @nothing_exe_studio
by PRew_ @ 2023-12-11 19:24:00
?? @fengguangxi
by PRew_ @ 2023-12-11 19:24:20
哦哦
by PRew_ @ 2023-12-11 19:24:51
cjf 君想调查学校 OI 组每个同学的生日,并按照年龄从大到小的顺序排序。但 cjf 君最近作业很多,没有时间,所以请你帮她排序。
输入共有
第
第
输出共有
即
3
Yangchu 1992 4 23
Qiujingya 1993 10 13
Luowen 1991 8 1
Luowen
Yangchu
Qiujingya
数据保证,