您的位置:首页 > 其它

Let the Balloon Rise(1004)

2014-03-13 14:12 253 查看
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1004
 

#include<stdio.h>

#include<iostream>

#include<string>

#include<map>

using namespace std;
int main(){
   
int n;
   
string str;
   
while(cin>>n&&n){
      map<string,
int>m;
      map<string,
int>::iterator ip,imax;
      for(inti =
0;i <n;i++){
          cin>> str;
          m[str]++;
       }
      int max =0;
      for(ip =m.begin();ip != m.end();ip++){
          if(ip->second > max){
              max  =ip->second;
              imax = ip;
           }
       }
      cout<< imax->first <<endl;
    }
   
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: