嗯……求N个数的最小公倍数,容易想到的就是先求前两个的公倍数,然后求这N-1个数的最小公倍数~~ </pre><pre code_snippet_id="606083" snippet_file_name="blog_20150218_3_2357580" name="code" class="cpp">#include<iostream> #include<cstring> #include<vector> #include<cstdio> #include<algorithm> using namespace std; const int MAX = 10010; int LCM(int n1,int n2) { int i,t=n1; for(i=1;t%n2;i++) t=i*n1; return t; } int main() {int n,i,a[MAX],t; while(cin>>n) { while(n--) {cin>>t; for(i=0;i<t;i++) cin>>a[i]; for(i=0;i<t-1;i++) a[i+1]=LCM(a[i],a[i+1]); cout<<a[i]<<endl; } } }