June 2017
Intermediate to advanced
532 pages
12h 59m
English
In this section, we will read all user input from standard input, which might, for example, be a text file containing an essay. We tokenize the input to words, in order to count which word occurs how often.
#include <iostream> #include <map> #include <vector> #include <algorithm> #include <iomanip>
using namespace std;
string filter_punctuation(const string &s) { const char *forbidden {".,:; "}; const auto idx_start (s.find_first_not_of(forbidden)); const ...Read now
Unlock full access