I'm trying to get the numbers into a file and calculate the GCM accordgingly. However I keep getting the NoSuchElementException.

```
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Prog280a {

public static void main(String[] args) {
    Scanner in = null;
    int greater = 1;
    int lesser = 1;
    int a = 1;
    int b = 1;
    int originalA = 0;
    int originalB = 0;

    try {
        in = new Scanner(new File(("C:\\Users\\####\\Desktop\\####\\Eclipse\\#######\\#######2\\src\\Prog280a.dat")));
    } catch (FileNotFoundException e) {
        System.out.println("File is not found try again.");
        System.exit(0);
    }

    while (in.hasNextInt()) {
        while (a != 0) {
            greater = in.nextInt();
            lesser = in.nextInt();
            if (greater > lesser) {a = greater; b = lesser;} else {b = greater; a = lesser;}
            originalA = a;
            originalB = b;
            a = a - b;
        }
        System.out.println("The GCD of " + originalA + " & " + originalB + " is " + b);
        a = 1;
        b = 1;
    }

}

}

```

Okay so in the line where I say. 'greater = in.nextInt();' the system says theres a nosuchelementexception. Why is it doing that? Please help.

Here is what it says:

```
Exception in thread "main" java.util.NoSuchElementException
at java.util.Scanner.throwFor(Unknown Source)
at java.util.Scanner.next(Unknown Source)
at java.util.Scanner.nextInt(Unknown Source)
at java.util.Scanner.nextInt(Unknown Source)
at Prog280a.main(Prog280a.java:25)

```

These are the numbers in the file by the way:
25 10 
81 41 
255 138 
847 624 
84 420 
182 637 
620 420 
36 24 
75 125 
1 17