Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int v[10];
- int main() {
- fstream f("bac.txt");
- int x, max = 0, nr_ord = 0, c = 0;
- while (f >> x) {
- c++;
- v[x / 10 % 10]++;
- if (v[x / 10 % 10] > max) {
- max++;
- nr_ord = c;
- }
- }
- cout << nr_ord << '\n';
- f.close();
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment