#include <iostream>
#include <map>
#include <string>
using namespace std;
int main()
{
map<string, size_t> m;
string word;
cout << "Enter some word:" << endl;
while (cin >> word) {
++m[word];
}
for (map<string, size_t>::iterator it = m.begin(); it != m.end(); ++it)
{
cout << it->first << " " << it->second << endl;
}
getchar();
return 0;
}
test c++
最新推荐文章于 2025-05-23 11:11:47 发布