Discuss / Python / 感觉自己写的有点奇葩。。。。

感觉自己写的有点奇葩。。。。

Topic source

昆鹏hi

#1 Created at ... [Delete] [Delete and Lock User]

if(n==1): print(a+'-->'+c) elif(n==2): print(a+'-->'+b) print(a+'-->'+c) print(b+'-->'+c) else: move(n-1,a,c,b) move(1,a,b,c) move(n-1,b,a,c)

廖雪峰

#2 Created at ... [Delete] [Delete and Lock User]

n==2的情况不需要


  • 1

Reply