题解 | 最大公因数与最小公倍数

最大公因数与最小公倍数

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

全部评论

相关推荐

累死的一条狗:***一人顶10人那你给我发10个人的工资总和吗
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务