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