2021-05-08
作者:互联网
int gcd(int a,int b){
int t;
while(a!=0){
t=b%a;
b=a;
a=t;
}
return b;
}
int main(){
int n,s,m,i,a;
scanf("%d",&n);
while(n!=0){
scanf("%d",&m);
s=1;
for(i=1;i<=m;i++){
scanf("%d",&a);
s=s/gcd(s,a)*a;
}
printf("%d\n",s);
n--;
}
return 0;
}
标签:b%,return,gcd,05,int,08,while,2021,scanf 来源: https://blog.csdn.net/qq_52198223/article/details/116539829