Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream in("maxcif.in");
- ofstream out("maxcif.out");
- int f[10]= {0},n,i,v[100001],mx=0;
- in>>n;
- for(i=1; i<=n; i++)
- in>>v[i];
- for(i=1; i<=n; i++)
- f[v[i]]++;
- for(i=0; i<=9; i++)
- if(f[i]>mx)
- mx=f[i];
- for(i=0; i<=9; i++)
- {
- if(f[i]==mx)
- out<<i<<" ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement