基本思想:分而治之(Divide and conquer)
模式:
思路:
代码解决:
func tower(i int,a,b,c string){
if i==1{
fmt.Println("plate 1: ",a," -> ",c)
}
if i>=2 {
tower(i-1, a, c, b)
fmt.Println("plate",i,":",a," -> ",c)
tower(i-1,b,a,c)
}
}
原文:https://www.cnblogs.com/sjx13/p/13664076.html