C++ simple code. Need to find repeating adjacent word
<p>I need to write code that checks whether or not the user inputted the same word twice, and if so, it will output a message stating that they did. So far, I have:</p>

<pre><code>#include &lt;iostream&gt;

using namespace std;

int main(){

    string previous = "";
    string current = "";

    while (cin&gt;&gt;current); {
        if(current == previous); {
            cout&lt;&lt;"repeated word";
        }
        previous=current;

    }
}
</code></pre>

<p>It compiles, but it won't output the message whenever the user types in the same word twice.</p>
