[HDOJ] problem_1004 【Let the Balloon Rise】
来源:互联网 发布:广州 深圳 知乎 编辑:程序博客网 时间:2024/06/09 01:36
[HDOJ] problem_1004 【Let the Balloon Rise】:
点击打开链接
#include<iostream>#include<cstdio>#include<map>#include<string>using namespace std;int main(){int i,j,n,t,max;string maxs,str;map<string,int> mp;map<string,int>::iterator it;while (scanf("%d",&t)!=EOF){mp.clear();if (!t)continue;for (i=1;i<=t;i++){cin>>str;mp[str]++;}max=0;for (it=mp.begin();it!=mp.end();it++){if (max<it->second){max=it->second;maxs=it->first;}}cout<<maxs<<endl;}return 0;}
这是我第一道用map解决的问题。学长之前讲了一下,似懂非懂。后来网上查了map的用法,琢磨了别人的代码,总算看懂了那么一点点,哈哈,还是把这道题A了!
发篇博客,鼓励自己一下哈哈
0 0
- [HDOJ] problem_1004 【Let the Balloon Rise】
- HDOJ Let the Balloon Rise
- hdoj let the balloon rise
- hdoj Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise (map)
- HDOJ P1004 Let the Balloon Rise
- HDOJ-1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- HDOJ Let the Balloon Rise(java)
- HDOJ 1004 Let the Balloon Rise
- hdoj 1004 Let the Balloon Rise
- hdoj.1004 Let the Balloon Rise 20140726
- HDOJ Let the Balloon Rise 1004
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise(水题)
- 【HDOJ】【1004】Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- 打包与混淆代码
- linux awk详解
- 今天开始学coffeeScript(二)
- 套接字选项之struct linger
- 去去去
- [HDOJ] problem_1004 【Let the Balloon Rise】
- Activiti-5.3-源码解析流程文档解析
- select(poll)系统调用实现解析(一)
- 记录Django开发心得
- ArcGIS教程:栅格河网矢量化
- hdoj 1166 敌兵布阵(线段树)
- Oracle sql语句执行顺序
- select(poll)系统调用实现解析(二)
- Kafka学习之consumer端部署及API