Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
88071 彭林江 19众数 C++ Accepted 8 MS 276 KB 387 2024-08-17 12:07:55

Tests(11/11):


Code:

#include<bits/stdc++.h> using namespace std; int t[1001]; // t[i]=5代表:第i个人有5票 int main(){ int n; // 代表一共有n个人来投票 cin >> n; int p; for(int i = 1; i <= n; i++){ cin >> p;; t[p]++; } int bz = 1;// 先让1号当一下班长 for(int i = 1; i <= 1000; i++){ if(t[i] > t[bz]){ bz = i; } } cout << bz; return 0; }