Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- char c=' ', ch;
- map<char, int> d;
- do {
- cin >> ch;
- ch = toupper(ch);
- if ('A' <= ch && ch <= 'Z')
- {
- d[ch]++;
- if ( d[c] < d[ch] || (d[c] == d[ch] && ch < c) )
- c = ch;
- }
- } while (ch != '.');
- cout << c << " " << d[c];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement