#include<iostream>
using namespace std;
void move(int n, char a, char b, char c)
{
if (n == 0)
return;
move(n - 1, a, c, b);
cout << a << "-->" << c << endl;
move(n - 1, b, a, c);
}
int main()
{
int n;
char a = 'A', b = 'B', c = 'C';
cin >> n;
move(n, a, b, c);
return 0;
}
标签:char,return,递归,int,move,问题,汉诺塔 From: https://www.cnblogs.com/atrue/p/17357435.html