Hanio (for my memory of Grade One)
来源:互联网 发布:discuz 标签 seo 编辑:程序博客网 时间:2024/06/10 21:54
突然想起大一学递归的时候,c++那本教材上的汉诺塔例子,当时不是很理解,今天翻出来看,有一番新感觉,有了新的体会,果然人真的是会成长的。当时觉得有点难的东西现在不会那么困惑了,所以说熟能生巧,时间也是能改变许多东西的。
/*2011-8-27author:BearFly1990*/package temp;import java.util.Scanner;public class Hanio {public static void main(String[] args) {Scanner console = new Scanner(System.in);while(true){int m = console.nextInt();hanio(m,'a','b','c');}}public static void hanio(int m, char one, char two, char three){if( m == 1){move(one , three);}else{hanio(m-1,one,three,two);move(one,three);hanio(m-1,two,one,three);}}public static void move(char x, char y){System.out.println(x+"--->"+y);}}
- Hanio (for my memory of Grade One)
- One Of My True Dreams
- In memory of my first job
- one of my ADF project demo(target_set)
- One day gotta change for my future
- My one day for Ubuntu 11.04
- Eclipse配置及问题解决 syntax highlighting disappeared for one of my files and Indexer missing many classes
- the photo of hengjiang middle school Grade 2001 class one graduate souvenir
- the photo of hengjiang middle school Grade 2001 class one graduate souvenir
- How to discover memory usage of my application in Android
- How to discover memory usage of my application in Android
- How to discover memory usage of my application in Android
- How to discover memory usage of my application in Android
- 挚爱 Theme of Love for My Sweatheart
- Log of Grade Two
- Out of memory. Type HELP MEMORY for your options (
- Out of memory. Type HELP MEMORY for your options
- One of My Blogs was closed of indefinite duratio on 3 September, 2006.
- cavlc编码level的原理和过程
- CAVLC编码过程详解——Sunrise
- prefix(2)
- Eclipse 快捷键
- CAVLC中的前缀和后缀——264小生
- Hanio (for my memory of Grade One)
- 那年,三支玫瑰的花语是我们每人一支
- Java 单态设计模式
- 导入导出Android手机文件
- 自定义标题栏
- SVN服务器配置
- Qt Programing With C++ (2nd) 之 find dialog
- poj 1716 Integer Intervals
- java多线程编程技术 +代码实例