#include #include #include #include #include using namespace std; int main() { string w; map counts; while (cin >> w) { if (counts.count(w)) ++counts[w]; else { counts[w] = 1; } } for (const auto &wordcount : counts) { // "range for" cout << "Word |" << wordcount.first << "| appears " << wordcount.second << endl; } for_each(std::execution::par_unseq, // parallel_unsequenced_policy begin(counts), end(counts), [](const auto &wordcount) { cout << "Word |" << wordcount.first << "| appears " << wordcount.second << endl; }); return 0; }