最大公约数与最小公倍数求和
小乐乐与欧几里得
http://www.nowcoder.com/questionTerminal/da13e0cf321e4df9acd0fdf0a433cbb0
#include<iostream> using namespace std; int main(){ long a,b,r,n; cin>>a>>b; r=a%b;//a>b时取r n=a*b; while(r){//r!=0;即a<b时情况 a=b; b=r; r=a%b; } cout<<b+n/b<<endl; return 0; }