题解:……
#include <iostream>
#include <cstdio>
using namespace std;
int a[100];
void move(int n,int a,int b,int c)
{
if(n==1) printf("%d from %c to %c\n", n, a, c);
else
{
move(n-1,a,c,b);
printf("%d from %c to %c\n", n, a, c);
move(n-1,b,a,c);
}
}
int main()
{
int n;
cin>>n;
cout<<(1<<n)-1<<endl;
move(n,'A','B','C');
return 0;
}