85pts求助(最后三个点没过)
查看原帖
85pts求助(最后三个点没过)
1053006
lijizhen_1101楼主2024/5/5 17:23
#include<bits/stdc++.h>
using namespace std;
int gcd(long long x,long long y)
{
	if(x%y==0) return y;
	else return gcd(y,x%y);
}
int lcm(long long x,long long y)
{
	return x*y/gcd(x,y);
}
int main()
{
	long long a,b,c,cnt=0;
	cin>>a>>b>>c;
	cnt=lcm(a,b);
	cnt=lcm(cnt,c);
	cout<<cnt;
	return 0;
}
2024/5/5 17:23
加载中...