zoj2104
来源:互联网 发布:js new一个对象 编辑:程序博客网 时间:2024/06/10 08:17
容器用起来还是很方便的。
#include <iostream>#include <string>#include <vector>using namespace std;int main(){ int num; while(cin >> num && num) { vector<string> popular; while(num--) { string color; cin >> color; popular.push_back(color); } int maxnum = 0,num = 0; string popu; for(vector<string>::iterator itbegin = popular.begin();itbegin != popular.end();itbegin++) { num = 0; for(vector<string>::iterator it = itbegin;it != popular.end();it++) { if(*it == *itbegin) num ++; } if(num > maxnum) { maxnum = num; popu = *itbegin; } } cout << popu << endl; } return 0;}
0 0
- zoj2104
- ZOJ2104
- zoj2104
- zoj2104
- ZOJ2104 2015/3/25
- ZOJ2104 Let the Balloon Rise
- ZOJ2104——Let the Balloon Rise
- HDU1004 ZOJ2104 Let the Balloon Rise【MAP】
- Hibernate 中 一对多、多对一、 关联关系的 配置
- 查看策略应用结果
- 暑期集训搜索专题(一)
- HDU 1869--六度分离 【任意点最短路】
- webkit 与 webcore
- zoj2104
- PAT (Basic Level) Practise (中文)1039. 到底买不买(20) C语言
- PCB参数计算神器-Saturn PCB Design Toolkit下载及安装指南
- Leetcode 14 Longest Common Prefix
- leetcode[137]:Single Number II
- 合并多个文本文件方法
- [cogs 886]完美的牛栏
- linux下安装mysql(server和client)
- PHP防注入攻击