照抄的程序又运行不了,卡在print那 invalid syntex
总在print那行报错 invalid syntex, 我已经不会input 和print语法了{:10_247:}#求最大公约数
def gcd(p,q):
while p%q!=0:
t=p%q
p=q
q=t
return q
a,b=(map(int,input().split())
print(gcd(a,b)) def gcd(p,q):
while p%q!=0:
t=p%q
p=q
q=t
return q
a,b=map(int,input().split()) # 这一行 = 右边多了一个括号
print(gcd(a,b)) 多了一个括号,请将它删掉
def gcd(p,q):
while p%q!=0:
t=p%q
p=q
q=t
return q
a,b=map(int,input().split())
print(gcd(a,b)) 谢谢~ 多谢两位大神 isdkz @sfqxx{:10_288:}
明白了 map前面不用这个 (多了个单括号,现在能行了
页:
[1]