OJ-Problems-Source/HDOJ/1722_autoAC.cpp
2016-08-17 15:12:28 +08:00

21 lines
306 B
C++

#include<iostream>
using namespace std;
int main()
{
int n,m,a,b;
while(cin>>n>>m)
{
a=n;
b=m;
while(a!=b)
{
if(a>b)
a-=b;
else
b-=a;
}
cout<<n+m-a<<endl;
}
return 0;
}