title: After I have pressed ENTER, the program did not output any results. Why is this happening?
body: <p>I'm new to C++. I saw this code online. After I have pressed ENTER, the program did not output any results.  Why is this happening? Could someone please help me out? thanks in advance for any help!</p>
  
  <pre><code>int main(){
      const string hexdigits = "0123456789ABCDEF";
      cout &lt;&lt; "enter a series of numbers between 0 and 15 separated by spaces. Hit ENTER when finished: " 
              &lt;&lt; endl;
      string result;
      string::size_type n;
      while(cin &gt;&gt; n){
          if(n &lt; hexdigits.size()){
              result += hexdigits[n];
          }
      }
      cout &lt;&lt; "your hex number is: " &lt;&lt; result &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I have entered input:</p>
  
  <pre><code>12 0 5 15 8 15
  </code></pre>