【笔记】汉诺塔

前言

汉诺塔

源代码

1
2
3
4
5
6
7
int hanoi(int n) {
if (n == 1) {
return 1;
} else {
return hanoi(n - 1) + hanoi(1) + hanoi(n - 1);
}
}

完成