12345678910111213141516171819202122 |
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string input;
- int index = 0;
- while (getline(cin, input)) {
- int record[26] = {0};
- for (int i = 0; i < input.length(); i++) {
- index = input[i] - 'a';
- record[index]++;
- }
- for (int i = 0; i < 26; i++) {
- cout << (char) ('a' + i) << ":" << record[i] << endl;
- }
- cout << endl;
- }
- return 0;
- }
|