hdu 1004 Let the Balloon Rise
来源:互联网 发布:php 判断类是否存在 编辑:程序博客网 时间:2024/05/16 05:05
很久没做题了,闲来无事,找了道水题玩玩。
这题用Map做的话,很简单,若改用其他方法,可能有点小麻烦。
#include <iostream>#include <map>#include <cstring>using namespace std;int main(){//freopen("1.txt","r",stdin);//freopen("2.txt","w",stdout);int n;map<string,int>m;string str;while(scanf("%d",&n)==1 && n){m.clear();for(int i=0;i<n;i++){cin >> str;m[str]++;}map<string,int>::iterator p,q;int max=-1;for(p=m.begin(); p!=m.end(); p++)if(p->second > max){max=p->second;q=p;}cout << q->first << endl;}return 0;}
- HDU 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- HDU--1004 Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- Hdu 1004 - Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise
- HDU--1004--Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- hdu 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise STL
- Oracle9i 字符集与NLS_LANG搭配测试兼乱码问题分析
- thinkphp多表查询语句
- 《Oracle编程艺术》学习笔记(4)-DEDICATED SERVER,SHARED SERVER,TNS,LISTENER
- iframe里的背景透明如何解决呢,下面的代码能帮到你!
- 通过JAVA—API访问HDFS 上的文件
- hdu 1004 Let the Balloon Rise
- C语言学习笔记
- 面试了一周,发现面试者有如下特点
- 谷歌加密用户搜索数据 意欲何为?
- C++沉思录读书笔记(4章)-限定用户只能读而不能写类数据成员的方法
- WebGL自学教程——WebGL示例:6. 第一个三维的物体:立方体
- Hello world !
- Messenger Password Decryptor
- 下载安装BlackBerry PlayBook NDK 开发环境