1 solutions

  • 0
    @ 2023-1-21 19:48:50
    #include <bits/stdc++.h>
    using namespace std;
    int a[15], n, m, ans,maxn;
    
    int main()
    {
        cin >> n;
        for (int i = 1; i <= n; i++)
        {
            cin >>m ;           //输入
            a[m]++;              //计数
        }
        for (int i = 1; i <= 10; i++)
        {
            if (a[i] > a[ans])          //判断大小
            {
                ans = i;                   //记录下标
            }
        }
        cout << ans;             //输出
        return 0;
    }
    
    
    • 1

    Information

    ID
    1219
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    # Submissions
    6
    Accepted
    3
    Uploaded By