Roman edited 3 年,7 月前
int GCD(int a, int b) { int temp; while (a % b != 0){ temp = a % b; a = b; b = temp; } return b; } int LCM(int a, int b) { return a * b / GCD(a,b); }