#include<iostream>
using namespace std;
void Hanoi(int n,char a,char b, char c)
{
if (n == 1)cout << "move" << a << "to" << c << endl;
else {
Hanoi(n - 1, a, c, b);
cout << "move" << a << "to" << c << endl;
Hanoi(n - 1, b, a, c);
}
}
int main()
{
Hanoi(3, 'A', 'B', 'C');
getchar();
}
07-26
2万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)