title: Comparing many numbers to find minimum and maximum
body: <p>To keep it simple lets say I have 3 whole numbers (integers) I know I can find the highest by using something like:</p>
  
  <pre><code>if(num1 &gt; num2 &amp;&amp; num1 &gt; num3)
      cout &lt;&lt; num1 &lt;&lt; endl;
  if(num2 &gt; num1 &amp;&amp; num2 &gt; num3)
      cout &lt;&lt; num2 &lt;&lt; endl;
  if(num3 &gt; num1 &amp;&amp; num3 &gt; num2)
      cout &lt;&lt; num3 &lt;&lt; endl; 
  </code></pre>
  
  <p>And the lowest:</p>
  
  <pre><code>if(num1 &lt; num2 &amp;&amp; num1 &lt; num3)
      cout &lt;&lt; num1 &lt;&lt; endl;
  if(num2 &gt; num1 &amp;&amp; num2 &gt; num3)
      cout &lt;&lt; num2 &lt;&lt; endl;
  if(num3 &lt; num1 &amp;&amp; num3 &lt; num2)
      cout &lt;&lt; num3 &lt;&lt; endl;
  </code></pre>
  
  <p>How can I get something like this to deal with equalities like 221,111,122,121.
  edit: Im trying to stay away from any prebuilt math includes as that is not the point here..</p>