#include<iostream>
#include<map>
using namespace std;
int main()
{
map<string,int> word_count;
string word;
while(cin >> word)
++word_count[word];
map<string,int>::iterator map_it =word_count.begin();
while(map_it != word_count.end())
{
cout << map_it->first << " " << map_it->second << endl;
++map_it;
}
return 0;
}
C++Primer习题10.9
最新推荐文章于 2022-10-31 14:32:40 发布