#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
using namespace std;
void dancijishu(istream& is);
int main() {
dancijishu(cin);
return 0;
}
void dancijishu(istream& is) {
map<string, size_t> m;
set<string> se{ "hehe","haha" };
string word;
string bd = "~!@#$%^&*()_+}{:\\\"?></*-+.`[]\;',./";//用來比對标點,其中有幾個字元需要轉義
while (is >> word) {
while (word.find_first_of(bd) != string::npos) {//查找出現的标點,并去除标點
word.erase(word.find_first_of(bd), 1);
}
for (auto &c : word) {//查找string内出現的大寫,轉為小寫
c = tolower(c);
}
if (se.find(word) == se.end()) {//計數
++m[word];
}
else {
cout << "您輸入的為過濾詞\n";
}
}
for (auto& c : m) {
cout << c.first << "次數為" << c.second;
}
}