title: A wrong result output in C++, when I add a statement
body: <p>I try to find the min and max value in a array (size is n) use <code>3 * (n // 2)</code> times comparison in once ergodic. And this is my code:  </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;initializer_list&gt;
  //!
  //! @Brief:get the minmum and maxmum in 3 * ( n // 2) times comparison.
  //! Create by Soyn. 31/7/15.
  //!
  
      bool IsOdd( size_t n)
      {
          return n % 2 ;
      }
      std::initializer_list&lt;int&gt; getLargerAndSmaller( int a, int b)
      {
          if(a &lt;= b){
              return {a,b};
          }else{
              return {b,a};
          }
      }
  
      int main(void)
      {
          int  Min, Max;
          int a[] = {5,4,1,7,3,8,3,4,9,10};
          int n = sizeof(a) / sizeof(a[0]);
          for( int i = 0; i &lt; n - 1; i += 2){
              if( (i ==0) &amp;&amp;IsOdd(n)){           // initialize the Min and Max.
                  Min = Max = a[i];
              } else{
                      auto item = getLargerAndSmaller(a[i],a[i+1]);
                      if(i == 0){
                              Min = *(item.begin());
                              Max = *(item.begin() + 1);
                              std :: cout &lt;&lt; "Min: " &lt;&lt; Min &lt;&lt; " , " &lt;&lt; "Max: " &lt;&lt; Max &lt;&lt; std :: endl;
                          }else{
                          std :: cout &lt;&lt; *(item.begin()) &lt;&lt; " , " &lt;&lt; *( item.begin() + 1) &lt;&lt; std :: endl;
                          Min &gt; *(item.begin()) ? Min = *(item.begin()) : Min;
                          Max &lt; *(item.begin() + 1) ? Max = *(item.begin() + 1) : Max;
                          std :: cout &lt;&lt; "Min: " &lt;&lt; Min &lt;&lt; " , " &lt;&lt; "Max: " &lt;&lt; Max &lt;&lt; std :: endl;
                          }
              }
          }
           return 0;
      }
  </code></pre>
  
  <p><strong>For testing my code, I add some statement in my code, like</strong></p>
  
  <blockquote>
    <p><code>std :: cout &lt;&lt; *(item.begin()) &lt;&lt; " , " &lt;&lt; *( item.begin() + 1) &lt;&lt; std :: endl;</code> </p>
  </blockquote>
  
  <p><strong>and this is the point I can't figure out. When I add this, the result is wrong.  If, I clear it, it works well. Following is the wrong result image:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/O8HcP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O8HcP.png" alt="enter image description here"></a></p>