题解 | #小乐乐与欧几里得#
小乐乐与欧几里得
https://www.nowcoder.com/practice/da13e0cf321e4df9acd0fdf0a433cbb0
#include <stdio.h> int main() { long m,n; while(scanf("%ld %ld",&m,&n)==2){ int i = m,j = n; int r; while(r = i%j){ i = j; j = r; } printf("%ld",m*n/j+j); } return 0; }