标签:
public static int gcd(int a, int b) {
int n1 = Math.abs(a);
int n2 = Math.abs(b);
int remainder = n1 % n2;
while (remainder > 0) {
n1 = n2;
n2 = remainder;
remainder = n1 % n2;
}
return n2;
}
标签:
原文地址:http://www.cnblogs.com/diyishijian/p/5023078.html