public class Recu { public static void divisorMax(int a,int b) { int c = 0; int d = 1; if (b == 0) { System.out.println("最大公约数为:"+ a); return; }else { c = a/b; d = a%b; } divisorMax(b,d); //递归调用此方法 } public static void main(String[] args) { divisorMax(15,25); } }