码迷,mamicode.com
首页 > 其他好文 > 详细

HDU 1004 Let the Balloon Rise

时间:2018-07-22 00:23:58      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:begin   bsp   out   span   class   let   style   can   clu   

技术分享图片

 1 #include<iostream>
 2 #include<cstdio>
 3 #include<map>
 4 using namespace std;
 5 int n;
 6 string s;
 7 map<string,int>m;
 8 int main()
 9 {
10     while(scanf("%d",&n)&&n)
11     {
12         m.clear();
13         for(int i=1;i<=n;i++)
14         {
15             cin>>s;
16             m[s]++;
17         }
18         map<string,int>::iterator ans=m.begin(),it;
19         for(it=m.begin();it!=m.end();it++)
20             if(it->second>ans->second)
21                 ans=it;
22         cout<<ans->first<<endl;
23     }
24     return 0;
25 }

 

HDU 1004 Let the Balloon Rise

标签:begin   bsp   out   span   class   let   style   can   clu   

原文地址:https://www.cnblogs.com/rlt1296/p/9348394.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!