题解 | 最大公因数与最小公倍数
最大公因数与最小公倍数
https://www.nowcoder.com/practice/ee732bec4f174cd9b4abc6427ba90584
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
using i128=__int128_t;
using u128=__uint128_t;
using ld=long double;
void solve()
{
ll a,b;//直接调用函数即可 但是不了解的一定要去学一下原理
cin >> a >> b;
cout << gcd(a,b) << " " << lcm(a,b);
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t=1;
//cin >> t;
while(t--)
{
solve();
}
return 0;
}