Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int A[10]{ 0 };
- int n;
- cin >> n;
- for (int i = 0; i < n; i++) {
- string str; cin >> str;
- for (char ch : str)
- A[ch - '0']++;
- }
- int max = 0; int Mindex = 0;
- for (int i = 0; i < 10; i++)
- if (A[i] > max) {
- max = A[i];
- Mindex = i;
- }
- for (int i = 0; i < 10; i++)
- if (A[i] == max) cout << i << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment