- 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
- #该片段来自于http://www.codesnippet.cn/detail/120320148986.html
来源: http://www.codesnippet.cn/detail/120320148986.html