标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 104108 Accepted Submission(s): 40046
思路:简单map
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
int n, max;
char s[100];
map<string,int> one;
map<string, int>::iterator itea;
string str;
while(cin>>n&&n)
{
while(n--)
{
cin>>str;
one[str]++;
}
for(max=0,itea=one.begin();itea!=one.end();++itea)
{
if(itea->second>max)
{
max=itea->second;
str=itea->first;
}
}
cout<<str<<endl;
one.clear();
}
}
HDU 1004 Let the Balloon Rise map
标签:
原文地址:http://www.cnblogs.com/Noevon/p/5557645.html