Hanoi Kuleleri

/* Hanoi kuleleri
Gçnderen Mustafa Başaran
*/
#include
using std::cout;
using std::cin;
using std::endl;
void tower(int n,char from,char to,char aux)
{
if(n==1)
{
cout<< "\n disk 1: " << from << "-->" << to;
return;
}
tower(n-1,from,aux,to); //n-1 diski geçici çubuga taşı
cout<<"\n disk " << n << ": " << from << "-->" << to; //kalan diski hedefe gönder
tower(n-1,aux,to,from); //geçici çubuktaki diskleri hedefe taşı
}
void main()
{
int n;

cout<< "Disk sayisini giriniz:";
cin>> n;

tower(n,'A','C','B');
}