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

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号