title: Find the minimum and maximum of an array with N elements
body: <p>I need to find min and max of an array with <code>N</code> elements. The fact is that my program is working but when I submit it on a website it gives me only <code>32</code> points out of <code>100</code> and I don't know what's wrong.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
      int N,min,max;
      cin &gt;&gt; N;
      min = N;
      max = N;
  
      int i,x;
      for (i = 1; i &lt;= N; ++i) {
          cin &gt;&gt; x;
  
          if ( x &lt; min ) {
              min = x;
          }
          if (x &gt; max) {
              max = x;
          }
      }
      cout &lt;&lt; min &lt;&lt;" "&lt;&lt; max;
      return 0;
  }
  </code></pre>