//
// main.cpp
// activity
//
// Created by 徐伟 on 6/13/16.
// Copyright © 2016 fizz. All rights reserved.
//
#include <iostream>
using namespace std;
const int discCount=3;
void move(int, char, char,char);
int main()
{
move(discCount,'A','B','C');
return 0;
}
void move(int n, char A, char B,char C)
{
if(n==1)
{
cout<<A<<"-->"<<C<<endl;
return;
}
else
{
move(n-1,A,C,B);
cout<<A<<"-->"<<C<<endl;
move(n-1,B,A,C);
return;
}
}
03-25