题解 | #小乐乐与欧几里得#
小乐乐与欧几里得
https://www.nowcoder.com/practice/da13e0cf321e4df9acd0fdf0a433cbb0
#include <stdio.h> long long gcd(long long a, long long b){ while(b != 0){ long long r = a % b; a = b; b = r; } return a; } long long lcm(long long a, long long b){ return a*b / gcd(a, b); } int main() { long long a, b; scanf("%lld %lld", &a, &b); printf("%lld", gcd(a, b) + lcm(a, b)); return 0; }