经典问题之汉诺塔(递归)

二话不说,直接上代码,注释全有ios #include<cstdio> #include<iostream> #include<algorithm> using namespace std; void hannuota(int n,char str,char mid,char dest) {//将str上的n个盘子,以mid为中转,移动到dest上 if(n == 1) {//只需移动一个
相关文章
相关标签/搜索