mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
997ec50f19
1700-1799
21 lines
306 B
C++
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;
|
|
}
|