标签:
Description
Input
Output
Sample Input
Sample Output
#include<stdio.h>
int GCD(int num, int x)
{
if(num%x==0)
return x;
return GCD(x, num%x);
}
int main ()
{
int n, x;
long long num;
while (scanf("%d", &n)!= EOF)
{
num = 1;
while (n--)
{
scanf ("%d", &x);
num = x/GCD(num,x)*num;
}
printf("%lld\n", num);
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/yishilin/p/4237215.html