1 条题解

  • -1
    @ 2026-2-10 16:31:35
    #include<bits/stdc++.h>
    using namespace std;
    void f(int n,char x,char y,char z){
    	if(n==0) return;
    	f(n-1,x,z,y);
    	cout<<n<<" "<<x<<" "<<z<<endl;
    	f(n-1,y,x,z);
    }
    int main(){
    	int n;
    	cin>>n;
    	f(n,'A','C','B');
    	return 0;
    }
    
    • 1

    信息

    ID
    34
    时间
    1000ms
    内存
    256MiB
    难度
    3
    标签
    (无)
    递交数
    106
    已通过
    58
    上传者