import java.util.Scanner;

public class GreatesCommonDivisor {
	public static int gcd(int a, int b) {
		return recursiveGcd(a, b, 1);
	}

	private static int recursiveGcd(int a, int b, int currentGcd) {
		for (int d = 2; d <= a && d <= b; ++d) {
			if (a % d == 0 && b % d == 0) {
				return recursiveGcd(a / d, b / d, currentGcd * d);
			}
		}
		return currentGcd;
	}

	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		System.out.println(gcd(a, b));
	}
}

@@ -101,176 +101,13 @@
 %7B%0A%09%09
-return recursiveGcd(a, b, 1);%0A%09%7D%0A%0A%09private static int recursiveGcd(int a, int b, int currentGcd) %7B%0A%09%09for (int d = 2; d %3C= a && d %3C= b; ++d) %7B%0A%09%09%09if (a %25 d == 0 && b %25 d
+if (b
  == 
@@ -111,17 +111,16 @@
 == 0) %7B%0A
-%09
 %09%09%09retur
@@ -125,80 +125,37 @@
 urn 
-recursiveGcd(a / d, b / d, currentGcd * d);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return currentGcd
+a;%0A%09%09%7D%0A%09%09return gcd(b, a %25 b)
 ;%0A%09%7D

Improve efficiency