文章
49
粉丝
90
获赞
9
访问
26.7k
#include<iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
int a0 = a, b0 = b;
if (a > b)
{
while (a)
{
int t = b;
b = a % b;
a = t % b;
}
cout << b << " " << a0 * b0 / b << endl;
}
else
{
while (b)
{
int t = a;
a = b % a;
b = t % a;
}
cout << a << " " << a0 * b0 / a << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发