40pts 求助!
查看原帖
40pts 求助!
791222
lby_commandBlock楼主2024/3/16 10:55
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;

int a, b;
long long gcd, lcm;

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> a >> b;
	gcd = __gcd(a, b);
	lcm = a * b * 1ll / gcd;
	cout << gcd << ' ' << lcm << endl;
	return 0;
}
2024/3/16 10:55
加载中...