1019.cpp
来自「杭电 acm部分代码 有兴趣的可以下载 谢谢」· C++ 代码 · 共 20 行
CPP
20 行
#include<stdio.h>
void main()
{
int test,n,i,t;
__int64 a,b,p;
scanf("%d",&test);
while(test--){
scanf("%d",&n);
a=1;
while(n--){
scanf("%I64d",&b);
if(a>b) {t=a;a=b;b=t;}
p=a*b;
while(a!=0) {t=b%a;b=a;a=t;}
if(b!=0) a=p/b;
}
printf("%I64d\n",a);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?