杭电ACM1722 //成长日记

#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;
}

猜你喜欢

转载自blog.csdn.net/qq_44364131/article/details/86670143
今日推荐