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[100002],mx=0;
- i = 1;
- while(in >> v[i])
- i++;
- n = i-1;
- 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