1004 Let the Balloon Rise
来源:互联网 发布:强制写作软件 编辑:程序博客网 时间:2024/06/06 00:15
#include<iostream>#include<string>using namespace std;int main(){ while (1) { char color[1000][15];//注意是全局变量还是局部变量 int count[1000] = { 0 };//注意是全局变量还是局部变量 int color_num; cin >> color_num; if (color_num == 0) { break; } if (color_num > 0 && color_num <= 1000) { int max = 0, k_max=0;//max:最多的颜色的数目 k_max:该颜色在数组中的位置 for (int i = 0; i < color_num; i++) { cin >> color[i]; for (int j = 0; j < i; j++) { if (strcmp(color[j], color[i])==0) { count[j]++; } } } for (int k = 0; k < color_num; k++) { if (count[k]>max) { k_max = k; } } cout << color[k_max] << 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
- 谈谈对Spring IOC的理解
- redis的持久化和缓存机制
- 你该不该懂点编程
- 无符号数与有符号数比较大小
- Linux下自定义环境变量
- 1004 Let the Balloon Rise
- 动态内存分配
- Educational Codeforces Round 19 A+B+C+E!
- NYOJ46 最少乘法次数(二进制思想)
- 2017.4.16 幂次方 思考记录
- POJ 2892-Tunnel Warfare(线段树单点更新-炸毁修复城市隧道)
- 关于Android单元测试
- java的枚举
- opencv学习(四十三)之图像的矩moments()