| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 66911 | 胡海峰老师 | 最简真分数 | Python3 | Compile Error | 0 MS | 0 KB | 492 | 2024-03-11 15:36:42 |
""" input 7 3 5 7 9 11 13 15 output 17 """ def max_common_divisor(x,y): if x<y: x,y = y,x t = y while t!=1: if x%t==0 and y%t==0: break t -=1 return t n = int(input()) a = list(map(int,input().split())) a.sort() cnt =0 for i in range(n-1): for j in range(i+1,n): ai = a[i] aj = a[j] if max_common_divisor(ai,aj)==1: print( f"{ai}/{aj}") cnt +=1 print(cnt)
File "Main.py", line 29
print( f"{ai}/{aj}")
^
SyntaxError: invalid syntax