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");
- int main()
- {
- int v[100],k = 0,x;
- for ( int i = 0 ; i < 100 ; ++i )
- v[i] = 0;
- while ( f >> x )
- {
- while ( x > 9 )
- {
- v[x % 100]++;
- x /= 10;
- }
- k++;
- }
- int maxim = -1;
- for (int i = 99 ; i >= 10 ; --i )
- if ( maxim < v[i] )
- maxim = v[i];
- for (int i = 99 ; i >= 10 ; --i )
- if ( v[i] == maxim )
- g << i << ' ';
- return 0;
- }
- Citește mai multe pe Brainly.ro - https://brainly.ro/tema/5103952#readmore
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement