Skip to content

Commit

Permalink
Merge pull request pezy#5 from Mooophy/master
Browse files Browse the repository at this point in the history
SYN
  • Loading branch information
Queequeg92 committed Nov 23, 2014
2 parents cc78ca1 + cdf7abf commit 4a06d66
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ch11/ex11_3_4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
//! Exercise 11.4
void word_count_pro(std::map<std::string, int> &m)
{
for(std::string word; std::cin >> word; /* */)
for(std::string word; std::cin >> word; /* */)
{
for(auto& ch : word) ch = std::tolower(ch);
std::remove_if(word.begin(), word.end(), ispunct);
for(auto& ch : word)
ch = std::tolower(ch);
word.erase(std::remove_if(word.begin(), word.end(), ispunct), word.end());
++m[word];

for (const auto &e : m)
std::cout << e.first << " : " << e.second <<"\n";
}
for (const auto &e : m)
std::cout << e.first << " : " << e.second <<"\n";
}

//! Exercise 11.3
Expand Down

0 comments on commit 4a06d66

Please sign in to comment.