辗转相除法求最大公约数Java实现
/*
* 最大公约数
*/
public static int GCD(int a,int b){
int c=a%b;
if (c==0) {
return b;
}else{
return GCD(b,c);
}
}
/*
* 最大公约数
*/
public static int GCD(int a,int b){
int c=a%b;
if (c==0) {
return b;
}else{
return GCD(b,c);
}
}