This commit is contained in:
Zengtudor 2024-09-01 22:01:13 +08:00
parent 448a747e56
commit 48b958c476
2 changed files with 26 additions and 1 deletions

22
20240901/6261/6261.cpp Normal file
View File

@ -0,0 +1,22 @@
#include <ios>
#include <iostream>
void HLT(int n,char a,char b,char c){
if(n==1){
std::cout<<a<<"->"<<n<<"->"<<c<<"\n";
return;
}
HLT(n-1, a, c, b);
std::cout<<a<<"->"<<n<<"->"<<c<<"\n";
HLT(n-1, b, a,c);
}
int main(){
std::ios::sync_with_stdio(false),std::cin.tie(0),std::cout.tie(0);
int n;
char a,b,c;
std::cin>>n>>a>>c>>b;
HLT(n, a, b, c);
}

View File

@ -36,3 +36,6 @@ target("P4089")
target("P2661")
add_files("20240830/P2661/P2661.cpp")
target("6261")
add_files("20240901/6261/6261.cpp")