Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
11988 徐一喆 众数 C++ Accepted 1 MS 752 KB 366 2021-05-18 16:59:20

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int main () { int a; while(scanf("%d", &a) != EOF) { int b[12] = {0}; b[a]++; for(int i = 1; i < 20; i++) { scanf("%d", &a); b[a]++; } int temp= 0, max = b[0]; for(int i = 1; i < 11; i++) if(b[i] > max){ max = b[i]; temp = i; } printf("%d\n" ,temp); } return 0; }