题解 | #小乐乐与欧几里得#
小乐乐与欧几里得
http://www.nowcoder.com/practice/da13e0cf321e4df9acd0fdf0a433cbb0
思路:了解最大公因数和最小公倍数的关系
int main(){
long long m,n;
scanf("%d %d",&m,&n);
long long p = m*n;
while(n!=0){
long long t=m%n;
m =n;
n = t;
}
long long max = m;
long long min = p/m;
printf("%lld",max+min);
return 0;
}