1004 成绩排名
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
struct Student
{
string Name;
string Id;
int Score;
};
bool Compare(Student &a,Student &b)
{
return a.Score>b.Score;
}
int main()
{
int n;
cin>>n;
Student *stu=new Student[n];
for(int i=0;i<n;i++)
{
cin>>stu[i].Name>>stu[i].Id>>stu[i].Score;
}
sort(stu,stu+n,Compare);
cout<<stu[0].Name<<" "<<stu[0].Id<<endl;
cout<<stu[n-1].Name<<" "<<stu[n-1].Id<<endl;
return 0;
}