summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <sancn@live.com>2017-05-02 09:39:39 +0200
committerSanto Cariotti <sancn@live.com>2017-05-02 09:39:39 +0200
commit3a16b6c2c63418aac8cce797d869b6c5ae341520 (patch)
tree47231cee3e28660de66dc0d5c41e6f7ac6f8bf83
parentf1558bb8d312178b341b267376e5bbb996c3cfdc (diff)
deleted hanoi.cc
-rw-r--r--cpp/hanoi.cc29
1 files changed, 0 insertions, 29 deletions
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 <iostream>
-
-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;
-}