题目1458:汉诺塔III(不一样的汉诺塔递归算法)

题目链接:http://ac.jobdu.com/problem.php?pid=1458

详解链接:https://github.com/zpfbuaa/JobduInCPlusPlus

参考代码:

//
// 1458 汉诺塔III.cpp
// Jobdu
//
// Created by PengFei_Zheng on 23/04/2017.
// Copyright © 2017 PengFei_Zheng. All rights reserved.
// #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <cmath> using namespace std;
int ans = ; long long hanoi(int n){
if(n==) return ;
if(n==) return ;
return *hanoi(n-)+;
} int n; int main(){
while(scanf("%d",&n)!=EOF){
printf("%lld\n",hanoi(n));
}
}
/**************************************************************
Problem: 1458
User: zpfbuaa
Language: C++
Result: Accepted
Time:0 ms
Memory:1520 kb
****************************************************************/
上一篇:HDU——2064汉诺塔III


下一篇:radar js