Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Wordlist::fillMap()
- {
- std::for_each(words.begin(), words.end(),
- [&](std::string s)
- {
- linkedWords[s]++;
- });
- }
- void Wordlist::minusA()
- {
- size_t size{};
- std::for_each(words.begin(),words.end(),[&size](std::string s){if(size < s.size()) size = s.size();});
- fillMap();
- std::for_each(linkedWords.begin(), linkedWords.end(),
- [size](std::pair<std::string,int> n)
- {
- std::cout << std::setw(size) << std::left << n.first << '\t' << n.second << std::endl;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement