汉诺塔III
2016-03-21 23:49
253 查看
#include <stdio.h> #include <stdlib.h> int main() { int fx(int ); int n,m; while(~scanf("%d",&n)) { m=fx(n); printf("%d\n",m); } return 0; } int fx(int n) { int m; if(n==1) m=2; if(n>1) m=3*fx(n-1)+2; return m; }
相关文章推荐
- UVA10954哈夫曼树与优先队列
- Spring源码之ApplicationContext(九)初始化剩余的单例
- Android 热补丁动态修复框架小结
- 没事画画图
- 1.1.2A+B for Input-Output Practice (II)
- Hrbust Online Judge 排列问题
- android的常用布局LinearLayout和RelativeLayout
- BZOJ4444 : [Scoi2015]国旗计划
- Codeforces 400C Inna and Huge Candy Matrix 【模拟】
- Spring源码之ApplicationContext(八)消息广播
- NYOJ-214-单调递增子序列(二)
- 基于django写的一个blog系统
- Debian下交换ctrl与esc键映射
- leetcode:Find Median from Data Stream
- 【ML】ICML2015_Unsupervised Learning of Video Representations using LSTMs
- 知识点5:ln链接
- python正则表达式
- The project target (Android N (Preview)) was not properly loaded.
- csh(tcsh)
- PSP记录个人项目耗时情况