import java.util.Scanner;
/**
* Created by James Shinevar on 6/10/17.
* james.shinevar@gmail.com
* http://jamesshinevar.com
*/
public class GCDMain {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Please enter your first number:");
long FirstNumber = input.nextLong();
input.nextLine();
System.out.println("Please enter your second number:");
long SecondNumber = input.nextLong();
input.nextLine();
System.out.println("SlowGCD is: " + SlowGCD(FirstNumber,SecondNumber));
}
private static long SlowGCD(long FirstNumber, long SecondNumber) {
long GCD = 0;
for (long counter = 1; counter < (FirstNumber + SecondNumber); counter++) {
if (FirstNumber % counter == 0) {
if (SecondNumber % counter == 0) {
GCD = counter;
}
}
}
return GCD;
}
}