Can someone explain this C++ code? : <p>I am a new here. I do not understand the if statement: i==0, It eliminates repetition. How it works? Thanks.</p>

<pre><code>vector&lt;string&gt;words;
for (string temp; cin &gt;&gt; temp;)
words.push_back(temp);
cout &lt;&lt; "Number of words:" &lt;&lt; words.size() &lt;&lt; '\n';
sort(words);
for (int i = 0; i &lt; words.size(); ++i)
    if (i == 0 || words[i - 1] != words[i])
        cout &lt;&lt; words[i] &lt;&lt; '\n';
</code></pre>
