📄 wordfreq.cpp
字号:
/* Copyright (C) 1999 Lucent Technologies */
/* From 'Programming Pearls' by Jon Bentley */
/* wordfreq.cpp -- List all words in input file, with counts */#include <iostream>#include <map>
#include <string>using namespace std;int main(){ map<string, int> M; map<string, int>::iterator j;
string t; while (cin >> t)
M[t]++; for (j = M.begin(); j != M.end(); ++j)
cout << j->first << " " << j->second << "\n";
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -