众数
我的代码
Lauguage
C++
Code
#include <bits/stdc++.h>
using namespace std;
int a[101];
int main()
{
int n;
cin>>n;
int i;
for(i=1;i<=n;i++){
int x;
cin>>x;
a[x]++;
}
int max=0;
for(i=0;i<=100;i++)if(a[i]>max)max=a[i];
for(i=0;i<=100;i++)if(a[i]==max)cout<<i<<" "<<max<<endl;
}
BYE~