June 2017
Intermediate to advanced
532 pages
12h 59m
English
In this section, we will read all user input from standard input, which we will tokenize by whole sentences, and not words. Then we will collect all sentences in an std::multimap paired with a variable carrying their length. Afterward, we output all sentences, sorted by their length, back to the user.
#include <iostream> #include <iterator> #include <map> #include <algorithm>
using namespace std;
Read now
Unlock full access