HDU 1004 Let the Balloon Rise
来源:互联网 发布:逆袭网络剧完整版 编辑:程序博客网 时间:2024/04/30 01:37
题目链接:Let the Balloon Rise
解题思路:直接用STL就可以做出来,用map的映射,形成一对一的关系。
#include<stdio.h>#include<string.h>#include<string>#include<map>using namespace std;int main(){string asd;char color[20]; int i, n, max, index;while(scanf("%d", &n) && n){max = -1;map<string, int> ball;getchar();for(i = 0; i < n; i++){scanf("%s", &color);asd = string(color); ball[asd]++;}for(map<string, int>::iterator it = ball.begin(); it != ball.end(); it++){if(it->second > max){max = it->second;asd = it->first;}}printf("%s\n", asd.c_str());}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
- java.lang.OutOfMemoryError: PermGen space解決
- 关于new的一个问题
- DataGridView查询数据
- 普利姆算法
- Web内部控件DropDownList
- HDU 1004 Let the Balloon Rise
- glTexCoord2f
- 为outlook增加“邮件召回”功能
- 大学该怎么读?
- C#中 如何执行带GO的sql 语句
- Oracle常用收集
- 深入理解Linux之copy_process()
- JS 实现图片直接下载
- POJ 3664