【C】#小乐乐与欧几里得#
小乐乐与欧几里得
https://www.nowcoder.com/practice/da13e0cf321e4df9acd0fdf0a433cbb0
#include <stdio.h> long gcd(int n, int m){ while(n % m){ int tmp = n % m; n = m; m = tmp; } return m; } int main() { long n, m; while (scanf("%ld %ld", &n, &m) != EOF) { printf("%ld", gcd(n, m) + n * m / gcd(n, m)); } return 0; }