女朋友不会求多位数的最小公倍数怎么办 LCM板子来了
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <map>
#include <set>
typedef long long LL;
using namespace std;
int main()
{
LL A,B,C;
cin>>B;
LL lcm=1;
while(B--)
{
cin>>C;
lcm=(lcm*C)/__gcd(lcm,C);
}
cout << lcm << endl;
return 0;
}
该代码是求B个数的LCM的板子