HDU - 1004 Let the Balloon Rise(map)
程序员文章站
2024-02-15 17:46:34
...
HDU - 1004 Let the Balloon Rise
#include<iostream>
#include<map>
using namespace std;
map<string,int>a;
int main()
{
int n;string s1,s2;
while(cin>>n&&n)
{
a.clear();
int maxn=-1;
while(n--)
{
cin>>s1;
a[s1]++;
if(a[s1]>maxn)
{
maxn=a[s1];
s2=s1;
}
}
cout<<s2<<endl;
}
return 0;
}
上一篇: yaf使用swoole