#include "iostream"
#include "string"
#include "vector"
using namespace std;
struct ballons
{
string color;
int count;
};
int main()
{
int N, i;
vector<ballons> v;
vector<ballons>::iterator it;
ballons temp;
bool tag;
while (cin >> N && N)
{
v.clear();
for (i = 0; i < N; i++)
{
cin >> temp.color;
temp.count = 1;
tag = false;
for (it = v.begin(); it != v.end(); it++)
{
if ((*it).color == temp.color)
{
(*it).count++;
tag = true;
}
}
if (!tag)
v.push_back(temp);
}
int max = 0;
string ans;
for (it = v.begin(); it != v.end(); it++)
{
if ((*it).count > max)
{
max = (*it).count;
ans = (*it).color;
}
}
cout << ans << endl;
}
}
zoj 2104 Let the Balloon Rise
最新推荐文章于 2019-10-28 17:00:20 发布