原题链接:https://leetcode-cn.com/problems/simplified-fractions/
vector<string> simplifiedFractions(int n) {
vector<string> res;
for (int y = 2; y <= n; y++) {
for (int x = 1; x < y; x++) {
if (gcd(x, y) == 1) {
string s = to_string(x) + "/" + to_string(y);
res.push_back(s);
}
}
}
return res;
}
最大公约数:greatest common divisor(gcd)
函数:gcd()
最小公倍数:lowest common multiple(lcm)
函数:lcm()