1004:Let the Balloon Rise
来源:互联网 发布:犀牛mac破解版下载 编辑:程序博客网 时间:2024/06/03 19:36
题目链接
STL map 的应用,遍历map求最大值
#include<iostream>#include<cstdio>#include<math.h>#include<cstring>#include<algorithm>#include<queue>#include<set>#include<map>using namespace std;int main(){int n;while(cin>>n&&n!=0){map<string,int> m;for(int i=0;i<n;i++){char s[100];cin>>s;m[s]++;}int mmax=0;string out;for(map<string,int>::iterator it=m.begin();it!=m.end();it++){if(it->second>mmax){mmax=it->second;out=it->first;}}cout<<out<<endl;}return 0;}
阅读全文
0 0
- 1004 Let the Balloon Rise
- 1004 Let the Balloon Rise
- 1004 Let the Balloon Rise
- 1004let the balloon rise
- Let the Balloon Rise 1004
- 1004 Let the Balloon Rise
- Let the Balloon Rise(1004)
- 1004Let the Balloon Rise
- Let the Balloon Rise(1004)
- Let the Balloon Rise(1004)
- 1004:Let the Balloon Rise
- 1004 let the balloon rise
- 1004 Let the Balloon Rise
- 1004 Let the Balloon Rise
- 1004-Let the Balloon Rise
- 1004 Let the Balloon Rise
- 1004 Let the Balloon Rise
- 1004 Let the Balloon Rise
- poj-1011-Sticks-(dfs+剪枝)
- mysql 两表联合查询数据多了很慢
- 常用的正则表达式(一)
- 最长公共子字符串
- Kotlin学习中
- 1004:Let the Balloon Rise
- Huffman编码压缩和解压文档,C++实现
- hibernate(三)
- scanf(“%c”)等问题,清空输入输出缓存
- JavaScript的选项卡操作
- Java技能清单
- Android音频系统
- Filter与Servlet的区别与联系
- git push 失败问题