Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream f("subnumar.in");
- ofstream g("subnumar.out");
- long long x,q,v[100],maxim;
- int main()
- {
- while(f>>x)
- {
- while(x>9)
- {
- q=x%100;
- v[q]++;
- if(v[q]>maxim)
- maxim=v[q];
- x=x/10;
- }
- }
- for(int i=99; i>=10; i--)
- {
- if(v[i]==maxim)
- g<<i<<" ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement