题目:hdu 1004
#include <map>
map<string, int>ballon;
string color, maxColor;
int n, max;
while (cin>>n&&n)
{
ballon.clear();
while (n--)
{
cin >> color;
ballon[color]++;
}
}
map<string, int>::iterator it;
max = 0;
for ( it =ballon.begin(); it != ballon.end(); it++)
{
if (it->second>max)
{
max = it->second;
maxColor = it->first;
}
}
cout << maxColor << endl;