计蒜客 - T1145 输出最高分数的学生姓名

https://vjudge.net/problem/%E8%AE%A1%E8%92%9C%E5%AE%A2-T1145

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
using namespace std;
struct node{
	int s;
	char name[25];
	bool operator<(const node w)const{
		return s>w.s;
	}
}g[110];
int main()
{
	int n;
	while(cin>>n)
	{
		for(int i=0;i<n;i++) cin>>g[i].s>>g[i].name;
		sort(g,g+n);
		cout<<g[0].name<<"\n";
	}
	return 0;
}
posted @ 2021-08-21 21:32  斯文~  阅读(17)  评论(0)    收藏  举报

你好!