提交时间:2023-10-07 13:18:41
运行 ID: 105540
#include<iostream> using namespace std; int n; void mov(int n,char A,char C,char B) { if(n==0)return; mov(n-1,A,B,C); cout<<A<<"->"<<C<<endl; mov(n-1,B,C,A); } int main(){ cin>>n; mov(n,'A','C','B'); return 0; }