title: How to find max int value from array
body: <ol>
  <li>User inputs positive int value (<code>number</code>);</li>
  <li>User prints <code>number</code> int values;</li>
  <li>Need to find max value and print it.</li>
  </ol>
  
  <p>My code is</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      int number;
      int max;
      int temp;
  
      scanf("%d", &amp;number);
      scanf("%d", &amp;max);
  
      for ( int i = 1; i &lt; number; i++ ) {
          scanf("%d", &amp;temp);
          if ( temp &gt; max ) {
              max = temp;
          }
      }
  
      printf("%d\n", max);
      return 0;
  }
  </code></pre>
  
  <p>This works but online test tool says i need to optimize code, because it uses too many operations. Arrays are forbidden. Can only use stdio.</p>