题目描述
求n个数的最小公倍数。
输入
多组测试数据,第一行一个数n (0 < n <= 10),下面n个数,integer范围内。
输出
这n个数的最小公倍数。
样例输入复制
5
6 3 5 4 2
样例输出复制
60
def gcd(a, b): while b: a, b = b, a % b return a def lcm(a,b): return a*b//gcd(a,b) while True: try: n=int(input()) s=input() res=1 for i in map(int,s.split()): res=lcm(res,i) print(res) except EOFError: break
不知道为啥我写成 for i in map(int,s.split(" ")):,就会报错Runtime Error
(RE)你的程序在运行时出错