C++简洁代码:
计算字符个数
http://www.nowcoder.com/questionTerminal/a35ce98431874e3a820dbe4b2d0508b1
C++简洁代码:
#include<bits/stdc++.h> using namespace std; int main() { string str; cin >> str; char ch; cin >> ch; unordered_map<char, int> map; for(char c : str) map[tolower(c)] ++; cout << map[ch]; return 0; }