#include<iostream>
#include<string>
#include<map>
using namespace std;
int main()
{
int n;
while(cin>>n&&n!=0)
{
//if(n==0)break;
map<string,int> m;
string x;
for(int i=0;i<n;i++)
{
cin>>x;
m[x]++;
}
int imost=0;
string smost;
for(map<string,int>::iterator i=m.begin();i!=m.end();++i)
{
if(i->second>imost)
{
imost=i->second;
smost=i->first;
}
}
cout<<smost<<endl;
}
return 0;
}
Saturday, 21 March 2009
HOJ ( acm.hdu.edu.cn ) 1004
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment