title: I have values from a text file that can only be counted if they are between 0 & 100, my code keeps skipping the first value
body: <p>I want to make it where the values I count from a text file can only be between 0 and 100, it can't be less than 0 or more than 100. The values in the text file are separated by spaces and sometimes lines
  ex: 57 59 38 60
  49 24 60 39
  I put in a if condition but it seems to be leaving out the first number even if that number is in the condition range, I assume it is because of my variable num, but I am not sure how to fix that.
  Here's my code:</p>
  <pre><code>import java.io.File;
  import java.io.IOException;
  import java.util.Scanner;
  
  public class ExamStats {
  
      
      static final int A = 90,
                       B = 80,
                       C = 70,
                       D = 60;
      public static void main(String[] args) throws IOException {
          
          double minimumScore = 0;
          double maximumScore = 0;
          //total count of various grades
          int totalCount = 0;
          double average = 0;
          double sum = 0;
          
          
          Scanner input = new Scanner(System.in);
          //asks for file's name
          System.out.print(&quot;Input File's name: &quot; );
          String inputFile = input.nextLine();
          //reads the files data
          File file = new File(inputFile);
          Scanner scanFile = new Scanner(file);
  
          int num = scanFile.nextInt();
      
      if(num &gt;= 0 &amp;&amp; num &lt;= 100) {
          while(scanFile.hasNextInt()) {
          
          
              sum += scanFile.nextInt();
              totalCount++;   
          }
      }
          average = sum/totalCount;
          
          System.out.println(&quot;Number of scores: &quot; + totalCount);
          System.out.printf(&quot;Average score: %.2f\n&quot;, average);
          scanFile.close();
  </code></pre>