Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. ///ifstream cin("subnumar.in");
  9. ///ofstream cout("subnumar.out");
  10. int x,y,v[100]={},subnr, maxx;
  11. while(cin >> x){
  12. while(x>9){
  13. subnr=x%100;
  14. v[subnr]++;
  15. x/=10;
  16. }
  17. }
  18.  
  19. for(int i=10;i<=99;i++){
  20. if(v[i]>maxx){
  21. maxx=v[i];
  22. }
  23. }
  24.  
  25. for(int i=99; i>=10;i--){
  26. if(v[i]==maxx){
  27. cout<<i<<" ";
  28. }
  29. }
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement