9 lines
199 B
Python
9 lines
199 B
Python
|
def han(start,end,temp,n):
|
||
|
if n==1:
|
||
|
return 0;
|
||
|
else:
|
||
|
han(start, temp, end, n - 1)
|
||
|
print(n, start, "---->", end)
|
||
|
han(temp, start, end, n - 1)
|
||
|
|
||
|
han("A","B","C",5)
|