| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160592 | Kevin | 众数 | C++ | Output Limit Exceeded | 28 MS | 272 KB | 554 | 2026-09-24 15:38:19 |
#include<iostream> using namespace std; int main() { int t; while(true) //多组输入 { int a[12] = {0}; //每组重新定义数组,自动清零计数 for(int i=1;i<=20;i++) { cin >> t; a[t]++; } int maxcnt = 0; int zhi; for(int i=1;i<=10;i++) { if(a[i] > maxcnt) { maxcnt = a[i]; zhi = i; } } cout << zhi << endl; } return 0; }