1 #include
2 #include
3 #include
4 #include
5 #include
6 #include
7 using namespace std;
8 struct Node{
9 int id;
10 char chr[13];
11 int age;
12 }node[35];
13 bool cmp(Node a,Node b)
14 {
15 if(a.age!=b.age) return a.age
16 if(a.id!=b.id) return a.id
17 return strcmp(a.chr,b.chr)<0;
18 }
19 vector vec;
20 int main()
21 {
22 int n;
23 while(cin>>n)
24 {
25 for(int i=0;i
26 {
27 cin>>node[i].id>>node[i].chr>>node[i].age;
28 vec.push_back(node[i]);
29 }
30 sort(vec.begin(),vec.end(),cmp);
31 int num=n<3?n:3;
32 for(int i=0;i
33 cout<
34 }
35 return 0;
36 }
标签:node,Node,职工,int,age,HUST,最小,vec,include
来源: https://www.cnblogs.com/jianqiao123/p/14370338.html