时间:2021-07-01 10:21:17 帮助过:49人阅读
代码如下:
times = 0
def test(num,a,b,c):
globaltimes
ifnum==1:
print (a,b)
times+=1
else:
test(num-1,a,c,b)
test(1,a,b,c)
test(num-1,c,b,a)
test(12,"a","b","c")
print "经过的步数passing:%d"%times