using System;
namespace ConsoleApp1
{
class Program
{
static int number = 0;
static void Move(char source,char destination)
{
Console.WriteLine("from {0} to {1}",source,destination);
}
static void haobi(int n,char a,char b,char c)
{
number++;
if (n == 1)
{
Move(a, c);
}
else
{
haobi(n - 1, a, c, b);
Move(a, c);
haobi(n - 1, b, a, c);
}
}
static void Main(String[] args)
{
haobi(3, 'a', 'b', 'c');
Console.WriteLine("spent {0} times", number);
}
}
}