#include <iostream>
#include <map>
#include <set>
#include <string>
#include <string.h>
using namespace std;
struct words{
string a;
int numbers = 0;
};
int main()
{
map<string,int> mp;
multimap<int,string> mmp;
char b[20];
cin >> b;
while (strcmp(b,"OVER") != 0){
string c = b;
mp[c]++;
cin >> b;
}
map<string,int>::iterator i;
for (i = mp.begin();i != mp.end();i ++){
cout << i->first << " counter: " << i->second << endl;
mmp.insert(make_pair(i->second,i->first));
}
cout << "********************************************************" << endl;
multimap<int,string>::iterator p;
for (p = m
map与set的简单综合应用,统计单词词频
最新推荐文章于 2022-07-26 17:09:25 发布