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");
- int x, v[100000],y, i=1,j,a,Vmax=0;
- while(f>>x)
- {
- v[i]=(x/10)%10;
- a=0;
- for(j=1;j<=i;j++)
- if(v[i]==v[j])
- a++;
- if(a>=Vmax)
- {Vmax=a; y=i;}
- i++;
- }
- cout<<y;
- f.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement