I am trying to replicate the dictionary example found in Bjarne Stroustrup's "Programming: Principles and Practice Using C++" (2016 ed)
The goal of the example is, given an input of some words, they're written out in order without any repetition.
I am using CodeBlocks 20.03, and when I tried to run the example, nothing showed up on the terminal. When I typed some input, it went through without any error messages, but with no response.
This is the code:
//simple dictionary: list of sorted words
#include "std_lib_facilities.h"; 
int main()
{
    vector<string> words;
    for(string temp; cin>>temp; )        //read whitespace-separated words
        words.push_back(temp);     //put into vector
    cout << "Number of words: " << words.size() << '\n';
    sort(words);                                     //sort the words
    for (int i = 0; i<words.size(); ++i)
        if (i==0 || words[i-1]!=words[i])//is this a new word?
        cout << words[i] << "\n";
    }
