Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- int main() {
- char ch;
- while (1) {
- int arr[127] = {}, max = 0;
- while ((ch = getchar()) != '\n') {
- if (ch == EOF) return 0;
- if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) ++arr[ch];
- }
- for (int i = 'A'; i <= 'z'; ++i) if (arr[i] > max) max = arr[i];
- for (int i = 'A'; i <= 'z'; ++i) if (arr[i] == max) putchar(i);
- printf(" %d\n", max);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement