title: Read input until the value is < 0
body: <p>There are plenty of implementations for any other language but not Fortran, and I was not able to adopt from them.</p>
  
  <pre><code>Sample Input:
  5 10 15 20 25 0
  Output:
  Array: [5, 10, 15, 20, 25]
  
  Sample Input:
  5
  10
  15
  20
  25
  0
  Output:
  Array: [5, 10, 15, 20, 25]
  </code></pre>
  
  <p>Both types of input should work (one-line and multiple lines). </p>
  
  <p>So, what I've tried is implied do loop (because I know exactly that I can read up to N values); however, I could not find a way to stop reading if the input is 0 or any other value.</p>
  
  <hr>
  
  <h2>What I've tried already</h2>
  
  <p>This piece of code clearly does not read values from one line:</p>
  
  <pre><code>do while (.not.input&lt;0)
      read *, input
  end do
  </code></pre>
  
  <p>And this one does not continue until implied do-loop ends</p>
  
  <pre><code>do while (.not.input&lt;0)
      read *, (x(i), i=1, 10)
      input = x(i)
  end do
  </code></pre>