C++ code isn't working...why?
<pre><code>set&lt;int&gt; numbers;
char userLetter;
int userNumber;

cout &lt;&lt; "Please enter a letter: ";
cin &gt;&gt; userLetter;

while(userLetter == 'X')
{
     cout &lt;&lt; "Please enter a number: ";
     cin &gt;&gt; userNumber;

     if (numbers.find(userNumber) != numbers.begin())
     {
          cout &lt;&lt; "Invalid!";
          continue;
     }
     else
     {
          numbers.insert(userNumber);
     }

     if(userNumber == 2)
          cout &lt;&lt; "Yes :)";
     else
          cout &lt;&lt; "No :(";

     cout &lt;&lt; "Please enter a letter: ";
     cin &gt;&gt; userLetter;
}
</code></pre>

<p>This is what happens when I run the program:</p>

<pre><code>Please enter a letter: X
Please enter a number: 2
Yes :)
Please enter a letter: X
Please enter a number: 2
Yes :)
Please enter a letter: X
Please enter a number: 2
Yes :)
...
</code></pre>

<p>Of course, the "X" and "2" are things that I enter. When I enter the second 2, shouldn't the program output "Invalid"?</p>

<p>Any help?</p>
