javaµÝ¹éʵÏÖººÅµËþ
/*
* ººÅµËþ£¬´ÓµÚ1¸öÖù×Ó½èÖúµÚ2¸ùÖù×ÓÒÆ¶¯µ½µÚ3¸ù
*/
public class TowerOfHano {
private int totle;//×ܹ²ÅÌ×ÓÊýÄ¿
public TowerOfHano(int totle){
this.totle=totle;
}
private void moveOne(int start,int end){
System.out.println("´Ó"+start+"ÒÆ¶¯Ò»¿éÅÌ×Óµ½"+end);
}
private void moveAll(int totle,int start,int temp,int end){
if(totle==1){
moveOne(start,end);
}else{
moveAll(totle-1,start,end,temp);
moveOne(start,end);
moveAll(totle-1,temp,start,end);
}
}
public static void main(String[] args) {
TowerOfHano tower = new TowerOfHano(3);//²âÊÔÈý¿éÅÌ×Ó
tower.moveAll(tower.totle, 1, 2, 3);
}
}
Ïà¹ØÎĵµ£º
ÄÇÌì°á¼ÒµÄʱºò²Å·¢ÏÖÓкܶàµÄ¶«Î÷£¬»¹¼ÇµÃÎÒ¸ÕÀ´µ½±±¾©µÄʱºòÕÒÁË·¿×Ó¾ÍһֱסÔÚÕâÀï¡£¿ªÊ¼Ã¦Âµ×ÅÕÒ¹¤×÷¡£ÕÒµ½Õâ·Ý¹¤×÷µÄʱºò±¾À´ÊÇÏë»»×ÅÄØ£¬Ã¿Ìì¶¼ÊÇ×öһЩÎÄ×Ö¼ÈëµÄ¹¤×÷·¢³îµÄÎÒ£¬²»¹ýÔÚÕâÀïÒ²ÊÇÓз¢Õ¹µÄ»ú»á£¬ÓеÄʱºòÕûÀíһЩ¹ØÓÚÊý¾Ý·½ÃæµÄ£¬ÈÃÐÂÀ´µÄ°ÑÊý¾Ý¼Èëµ½µçÄÔÉÏ£¬ÎÒÃÇÒ²ÊÇ×öÍâ°üµÄ¡£µ«Ê ......
×î½üÑо¿ÁËÏ·ÖÒ³£¬×ö¸ö×ܽᡣ
1£©Êý¾Ý¿â²Ù×÷Àà,×ö¼òµ¥·â×° DB.java
package Test;
import java.sql.*;
public class DB {
// ¼ÓÔØÇý¶¯
static {
try {
Class.f ......
package fileTest;
import java.io.*;
public class FileOperate {
public FileOperate() {
}
public static void main(String args[]){
// newFolder("D:/100");
moveFile("e:/978 ......
Ò»¡¢java·ÃÎÊÖÐÎÄOracleÊý¾Ý¿âÉÏÁ¬½ÓµÄUS7ASCIIÊý¾Ý¿â
1¡¢¶Á·½·¨
public String convertLink_DB(String s) {
if(s != null){
try{
byte[] b = s.getBytes();
for(int i=0; i<b.length; i++){
b[i] ......