From 3a16b6c2c63418aac8cce797d869b6c5ae341520 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 2 May 2017 09:39:39 +0200 Subject: deleted hanoi.cc --- cpp/hanoi.cc | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 cpp/hanoi.cc (limited to 'cpp') diff --git a/cpp/hanoi.cc b/cpp/hanoi.cc deleted file mode 100644 index b401060..0000000 --- a/cpp/hanoi.cc +++ /dev/null @@ -1,29 +0,0 @@ -// ConsoleApplication1.cpp : definisce il punto di ingresso dell'applicazione console. -// -#include "stdafx.h" -#include - -using namespace std; - -static unsigned long int tot = 0; - -void hanoi(int d, int inizio, int fine, int transito) -{ - if (d == 1); - else { - hanoi(d - 1, inizio, transito, fine); - hanoi(d - 1, transito, fine, inizio); - } - tot++; -} - -int main() -{ - int dischi; - cout << "Numero dischi: "; - cin >> dischi; - - hanoi(dischi, 1, 3, 2); - cout << "In totale: " << tot << " mosse" << endl; - return 0; -} -- cgit v1.2.3-18-g5258