信息
- ID
- 1303
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 4
- 标签
- 递交数
- 89
- 已通过
- 44
- 上传者
#include<bits/stdc++.h>
using namespace std;
void move(int n,char x,char y,char z){
if(n==1) cout<<x<<"-"<<z<<endl;
else{
move(n-1,x,z,y);
cout<<x<<"-"<<z<<endl;
move(n-1,y,x,z);
}
}
int main(){
int n;
cin>>n;
move(n,'A','B','C');
return 0;
}
//
// __ __ __
// / / / /_ ______/ /________
// / /_/ / / / / __ / ___/ __ \
// / __ / /_/ / /_/ / / / /_/ /
// /_/ /_/\__, /\__,_/_/ \____/
// /____/
//