Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream f("BAC.txt");
- struct {int a=0, p;}v[10];
- int x,i=1,Vmax=0;
- while (f>>x)
- {
- v[(x/10)%10].a++;
- v[(x/10)%10].p = i;
- i++;
- }
- for(i=1;i<=9;i++)
- if(v[i].a>=Vmax)
- Vmax=v[i].a;
- for(i=1;i<=9;i++)
- if(v[i].a==Vmax)
- cout<<v[i].p<<' ';
- f.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement