Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
86601 丁俊杰 猜数字 Python3 Accepted 126 MS 3752 KB 456 2024-07-26 23:02:43

Tests(1/1):


Code:

n=int(input()) results=[] for i in range(n): a,b,c=map(int,input().split()) for g in range(1000,10000): if g%a==0 and (g+1)%b==0 and (g+2)%c==0: results.append(g) break #找到符合条件的g,终止循环 else: #如果没有执行break,即没有找到符合条件的g results.append("Impossible") for result in results: print(result) #第二种方法用两次for循环