public class ErweiterterEuklidischerAlgorithmus { public static int[] EEA(int a, int b) { int result[] = new int[2]; if (b == 0) { result[0] = 1; result[1] = 0; return result; } else { int temp[] = new int[2]; temp = EEA(b, a%b); result[0] = temp[1]; result[1] = temp[0] - ((a - a%b) / b) * temp[1]; return result; } } public static void main(String[] args) { int test[] = EEA(792,75); System.out.println("ggT(792,75) = 792 * (" + test[0] + ") + 75 * (" + test[1] + ")"); } }