题目1057:众数
来源:互联网 发布:手机版施工软件 编辑:程序博客网 时间:2024/06/05 03:15
#include <iostream>#include <stdio.h>#include <algorithm>#include <math.h>#include <string>#include <string.h>#include <vector>using namespace std;//1057int num[11];int main(){ int t; while(scanf("%d",&t)!=EOF){ memset(num,0,sizeof(num)); num[t]++; for(int i=1;i<=19;i++){ scanf("%d",&t); num[t]++; } int maxn=-1,index=-1; for(int i=1;i<=10;i++){ if(num[i]>maxn){ maxn=num[i]; index=i; } } printf("%d\n",index); } return 0;} /************************************************************** Problem: 1057 User: cust123 Language: C++ Result: Accepted Time:0 ms Memory:1520 kb****************************************************************/
0 0
- 题目1057:众数
- 题目1057:众数
- 题目1057:众数
- 题目1057:众数
- 题目1057:众数
- 题目1056:最大公约数 题目1057:众数
- 九度OJ—题目1057:众数
- 九度 Online Judge 算法 刷题 题目1057:众数
- NYOJ 题目95 众数问题
- NYOJ---题目95众数问题
- 九度 题目1057:众数 2011年 哈尔滨工业大学 计算机 研究生 机试真题
- 九度1057 众数
- 九度 1057 众数
- 九度-1057-众数
- 众数
- 众数
- 众数
- 众数
- 使用MultiDex解决65535限制问题
- STL----iterator 迭代器
- More is Less——卷积网络加速
- Java类的访问权限
- RecyclerView自定义分割线————列表分割线
- 题目1057:众数
- Java扑克牌小游戏
- eclipse对比idea快捷键
- ViewPager设置预加载界面个数
- Web应用安全之CSRF
- Boost Serialization 库
- Java学习之HttpURLConnection添加对https信任
- 关于编程中的内存管理
- Revit开发之调用Revit命令的另一种方法