求助,悬2关
查看原帖
求助,悬2关
494956
kkksc03___is_sb楼主2023/11/14 16:48
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

struct city
{
	string s;
	int t;
}a[105];

bool cmp(city x, city y)
{
	return x.t < y.t;
}

int main()
{
	int cur = 1;
	while(cin >> a[cur].s >> a[cur].t)
	{
		cur++;
	}
	cur--;
	sort(a + 1, a + cur + 1, cmp);
	cout << a[1].s << endl;
	return 0;
}
2023/11/14 16:48
加载中...