HDU——1004——Let the Balloon Rise
来源:互联网 发布:工程造价数据库 编辑:程序博客网 时间:2024/06/06 00:37
#include <iostream>#include <map>using namespace std;int main(){int n;char s[100];while(cin>>n){if(n==0)return 0;map<string ,int>map1;map<string ,int>::iterator p;for(int i=0;i<n;i++){ cin>>s; map1[s]++;}int tem=0;string ans;for(p=map1.begin();p!=map1.end();p++){ if(tem<p->second){tem=p->second;ans=p->first;}//cout<<ans<<endl;}cout<<ans<<endl;}return 0;}
Sample Input
5greenredblueredred3pinkorangepink0
Sample Output
redpink
- HDU 1004 — Let the Balloon Rise
- HDU-1004—Let the Balloon Rise
- HDU——1004——Let the Balloon Rise
- 【map热手题】HDU 1004—Let the Balloon Rise
- 1004—Let the Balloon Rise
- hdu1004——Let the Balloon Rise
- HDU1004——Let the Balloon Rise
- hdu1004——Let the Balloon Rise
- ZOJ2104——Let the Balloon Rise
- HDU1004——Let the Balloon Rise
- hdu1004——Let the Balloon Rise
- Let the Balloon Rise—STL(map)
- hdu1004—Let the Balloon Rise
- 杭电1004——Let the Balloon Rise
- 杭电1004——Let the Balloon Rise
- 杭电ACM—1004 Let the Balloon Rise
- 杭电OJ——Let the Balloon Rise
- 2104:Let the Balloon Rise——map容器
- win7 下开机启动
- linux配置ftp服务
- Android FrameWork——Binder机制详解(1)
- 对Hadoop中一段将字节码数组转换为Integer的代码的思考
- JDK6、Oracle11g、Weblogic10 For Linux64Bit安装部署说明
- HDU——1004——Let the Balloon Rise
- Android FrameWork——Binder机制详解(2)
- vsftpd配置文件详解
- Django url - view - template NOTE
- xcode 4 制作静态库详解
- Hibernate配置文件属性详解
- "指针+int " 的结果详解。
- 使用选择集选择最后一个对象并删除
- 225 c小加之随机数