hdu 2028 Lowest Common Multiple Plus (n个数的最大公倍数)
#include <stdio.h> int slyar(int x,int y) { while(x>y?(x%=y):(y%=x)); return x+y; } int main() { int i,n,a[100]; __int64 sum; while(scanf("%d",&n)!=EOF) { for(i=0;i<n;i++) scanf("%d",&a[i]); sum=a[0]; for(i=1;i<n;i++) sum=sum*(a[i]/slyar(a[i],sum)); printf("%I64d\n",sum); } return 0; }