mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
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;
|
||
|
}
|