main.cpp 460 B

12345678910111213141516171819202122
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main() {
  5. string input;
  6. int index = 0;
  7. while (getline(cin, input)) {
  8. int record[26] = {0};
  9. for (int i = 0; i < input.length(); i++) {
  10. index = input[i] - 'a';
  11. record[index]++;
  12. }
  13. for (int i = 0; i < 26; i++) {
  14. cout << (char) ('a' + i) << ":" << record[i] << endl;
  15. }
  16. cout << endl;
  17. }
  18. return 0;
  19. }