update
This commit is contained in:
parent
448a747e56
commit
48b958c476
22
20240901/6261/6261.cpp
Normal file
22
20240901/6261/6261.cpp
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user