文章
37
粉丝
98
获赞
4
访问
22.6k
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int gcd(int a,int b) {
if (b == 0) return a;
else return gcd(b, a % b);
}
int main()
{
int x, y;
cin >> x >> y;
//最大公约数
int max_num = gcd(x, y);
int min_num = x * y / max_num;
cout << max_num << " " <<min_num<< endl;
return 0;
}
登录后发布评论
暂无评论,来抢沙发