#include<iostream>using namespace std;void Move (int n,char a,char b,char c){ if (n==1)cout<<a<<"-->"<<c<<endl; else { Move(n-1,a,b,c);//把n-1个金片从a移到b,以c为过度 cout<<a<<"-->"<<c<<endl; Move(n-1,b,a,c);//把n-1个盘子从b移到c,以a为过渡 }} int main(){ int m; cout<<"Input the number of disks:"<<endl; cin>>m; Move(m,'A','B','C');}