Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <fstream>
  2.  
  3. using namespace std;
  4. ifstream f("subnumar.in");
  5. ofstream g("subnumar.out");
  6. long long x,q,v[100],maxim;
  7. int main()
  8. {
  9. while(f>>x)
  10. {
  11. while(x>9)
  12. {
  13. q=x%100;
  14. v[q]++;
  15. if(v[q]>maxim)
  16. maxim=v[q];
  17. x=x/10;
  18. }
  19. }
  20. for(int i=99; i>=10; i--)
  21. {
  22. if(v[i]==maxim)
  23. g<<i<<" ";
  24. }
  25.  
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement