Project Euler 005
T5 n阶乘的最小公倍数
#include <bits/stdc++.h>
using namespace std;
#define int long long
int gcd(int a,int b) {
return b == 0 ? a : gcd(b,a % b);
}
int lcm(int a,int b) {
return a / gcd(a,b) * b;
}
signed main () {
int res = 1;
for(int i = 1;i <= 20; i ++) {
res = lcm(res,i);
}
cout << res << endl;
return 0;
}