Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <cstdio>
  2. int main() {
  3. char ch;
  4. while (1) {
  5. int arr[127] = {}, max = 0;
  6. while ((ch = getchar()) != '\n') {
  7. if (ch == EOF) return 0;
  8. if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) ++arr[ch];
  9. }
  10. for (int i = 'A'; i <= 'z'; ++i) if (arr[i] > max) max = arr[i];
  11. for (int i = 'A'; i <= 'z'; ++i) if (arr[i] == max) putchar(i);
  12. printf(" %d\n", max);
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement