#include <iostream>
#include <map>
using namespace std;
map<string,int>balloon;
int main()
{
string co,maxco;
int n,m;
while(cin>>n && n)
{
balloon.clear();
while(n--)
{
cin>>co;
balloon[co]++;
}
map<string,int>::iterator it;
m=0;
for(it=balloon.begin();it!=balloon.end();it++)
{
if(it->second > m)
{
m = it->second;
maxco=it->first;
}
}
cout<<maxco<<endl;
}
return 0;
}
hdu 1004 Let the Balloon Rise(map的使用1)
最新推荐文章于 2019-09-21 18:38:27 发布