摘要:
unsigned int gcd(unsigned int a, unsigned int b){ unsigned int rem; while (b != 0) { rem = a % b; a = b; b = rem; } return a;}Euclidean辗转相除法unsigned int lcm(unsigned int a, unsigned int b){ return a / gcd(a, b) * b;}根据 greatest common divisor 求 least common multiple 阅读全文