n=10
塔1->塔3
herrDeng網內搜尋
自訂搜尋
Ads
2011年12月1日 星期四
訂閱:
張貼留言 (Atom)
熱門文章
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
python pandas對黃金、外匯匯率的爬蟲練習,並使用matplotlib.pyplot的函數plot, scatter做資料視覺化處理,採用numpy的統計函數,分析黃金價格波動與歐元走勢的關聯。
-
Python C C++ 2 pointer速解Leetcode 2337 Move Pieces to Obtain a String 多日Leetcode的問題都可用2-pointer法來解,今日2337. Move Pieces to Obtain a String也不例...
-
你會用C的算子sizeof?
50 則留言:
package pack1;
public class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從 "+peg1+"移到 "+peg3);
else{
hanoiTower(dishs-1,peg1,peg2,peg3);
System.out.println("盤子從 "+peg1+"移到 "+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
public class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從 "+peg1+"移到 "+peg3);
else{
hanoiTower(dishs-1,peg1,peg2,peg3);
System.out.println("盤子從 "+peg1+"移到 "+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package p1;
public class b1 {
static void hanoiTower(int dishs, int peg1, int peg2, int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1, peg1, peg2, peg3 );
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1, peg2, peg1, peg3 );
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs, 1, 2, 3);
}
}
package pack1;
public class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從 "+peg1+"移到 "+peg3);
else{
hanoiTower(dishs-1,peg1,peg2,peg3);
System.out.println("盤子從 "+peg1+"移到 "+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
public class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從 "+peg1+"移到 "+peg3);
else{
hanoiTower(dishs-1,peg1,peg2,peg3);
System.out.println("盤子從 "+peg1+"移到 "+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
public class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從 "+peg1+"移到 "+peg3);
else{
hanoiTower(dishs-1,peg1,peg2,peg3);
System.out.println("盤子從 "+peg1+"移到 "+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
public class A1 {
/**
* @param args
*/
static void hanoiTower(int dishs,int peg1,int peg2,int peg3)
{
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg1,peg3,peg2);
}
}
public static void main(String[] args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class CH4 {
static void hanoiTower(int dishs , int peg1, int peg2, int peg3)
{
if (dishs ==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs =10;
hanoiTower(dishs, 1,2,3);
}
}
public class CH4 {
static void hanoiTower(int dishs, int peg1, int peg2, int peg3)
{
if ( dishs ==1 )
System.out.println("盤子從 "+peg1+"移到 "+peg3);
else {hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從 "+peg1+"移到 "+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs, 1,2,3);
}
}
package pack1;
public class t1 {
static void hanoiTower (int dishs,int peg1,int peg2,int peg3 )
{
if(dishs == 1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main (String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
import java.util.*;
class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
import java.util.*;
class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
import java.util.*;
class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class b1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3) {
if(dishs == 1) {
System.out.println("盤子從" + peg1 + " 移到" + peg3);
}
else {
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從" + peg1 + " 移到" + peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class t2
{
static void hanoiTower(int dishs,int peg1,int peg2,int peg3)
{
if(dishs == 1)
{System.out.println("盤子從"+peg1+"移到"+peg3);}
else
{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("從盤子"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args)
{
int n = 10;
hanoiTower(n ,1,2,3);
}
}
package pack1;
import java.util.*;
class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
import java.util.*;
class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class B9933051
{
static void hanoitower(int dishs, int peg1, int peg2, int peg3)
{
if(dishs == 1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else
{
hanoitower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoitower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args)
{
int dishs=10;
hanoitower(dishs,1,2,3);
}
}
package dddfsfd;
public class dfsfsf {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3)
{
if(dishs == 1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else {
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args)
{
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class b1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3) {
if(dishs == 1) {
System.out.println("盤子從" + peg1 + " 移到" + peg3);
}
else {
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從" + peg1 + " 移到" + peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
import java.util.*;
class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class b1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3) {
if(dishs == 1) {
System.out.println("盤子從" + peg1 + " 移到" + peg3);
}
else {
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從" + peg1 + " 移到" + peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class b1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3) {
if(dishs == 1) {
System.out.println("盤子從" + peg1 + " 移到" + peg3);
}
else {
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從" + peg1 + " 移到" + peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class b1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3) {
if(dishs == 1) {
System.out.println("盤子從" + peg1 + " 移到" + peg3);
}
else {
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從" + peg1 + " 移到" + peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack;
public class pack {
static void hanoiTower(int dishs, int peg1, int peg2,int peg3 )
{
if(dishs == 1)
System.out.println("盤子"+peg1+"移到"+peg3);
else
{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs = 10;
hanoiTower(dishs, 1,2,3);
}
}
package V1;
public class B9933052A {
static void hanoiTower(int dishs, int peg1, int peg2, int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1, peg1, peg2, peg3 );
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1, peg2, peg1, peg3 );
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs, 1, 2, 3);
}
}
package pack1;
public class L1 {
static void hanoiTower(int dishs,int peg1,
int peg2, int peg3){
if (dishs ==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main (String[] args ){
int dishs = 10;
hanoiTower(dishs,1,2,3);
}
}
package V1;
public class V1 {
static void hanoiTower (int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg1,peg3,peg2);
}
}
public static void main(String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package V1;
public class V1 {
static void hanoiTower (int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg1,peg3,peg2);
}
}
public static void main(String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class b1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3)
{
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg1,peg3,peg2);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package P1;
public class A2 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3)
{
if( dishs== 1)
System.out.println("盤 子從" + peg1 + "移至 "+ peg3);
else{
hanoiTower(dishs-1,peg1,peg2,peg3);
System.out.println("盤 子從" + peg1 + "移至 "+ peg3);
hanoiTower(dishs-1,peg2,peg3,peg1);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
public class A1 {
/**
* @param args
*/
static void hanoiTower(int dishs,int peg1,int peg2,int peg3)
{
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg1,peg3,peg2);
}
}
public static void main(String[] args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
public class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3)
{
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg1,peg3,peg2);
}
}
public static void main(String[] args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class B1 {
static void hnt(int dishs,int peg1,int peg2,int peg3){
if (dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hnt(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hnt(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hnt(dishs,1,2,3);
}
}
public class B1 {
static void hnt(int dishs,int peg1,int peg2,int peg3){
if (dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hnt(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hnt(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hnt(dishs,1,2,3);
}
}
import java.io.*;
public class b1 {
public static void hanoi(int n, char f, char u, char t)
{
if (n == 1)
{
System.out.println(" Dish "+ n +"\t從 "+ f +" 搬移到 "+ t);
}
else
{
hanoi(n-1,f,t,u);
System.out.println(" Dish "+ n +"\t從 "+ f +" 搬移到 "+t);
hanoi(n-1,u,f,t);
}
}
public static void main(String[] args) throws IOException
{
int i,k;
char f='A',u='B',t='C';
BufferedReader kb=new BufferedReader(new InputStreamReader(System.in));
String x;
System.out.println("河內塔小遊戲=========\n");
System.out.print("請輸入盤子數量:\t");
x=kb.readLine(); k=Integer.parseInt(x); hanoi(k,f,u,t);
}
}
import java.io.*;
public class X1 {
public static void hanoi(int n, char f, char u, char t)
{
if (n == 1)
{
System.out.println(" Dish "+ n +"\t從 "+ f +" 搬移到 "+ t);
}
else
{
hanoi(n-1,f,t,u);
System.out.println(" Dish "+ n +"\t從 "+ f +" 搬移到 "+t);
hanoi(n-1,u,f,t);
}
}
public static void main(String[] args) throws IOException
{
int i,k;
char f='A',u='B',t='C';
BufferedReader kb=new BufferedReader(new InputStreamReader(System.in));
String x;
System.out.println("河內塔小遊戲=========\n");
System.out.print("請輸入盤子數量:\t");
x=kb.readLine(); k=Integer.parseInt(x); hanoi(k,f,u,t);
}
}
public class b9733054 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package P1;
import java.io.*;
public class A1
{
public static void hanoi(int n, char f, char u, char t)
{
if (n == 1)
{
System.out.println(" Dish "+ n +"\t從 "+ f +" 搬移到 "+ t);
}
else
{
hanoi(n-1,f,t,u);
System.out.println(" Dish "+ n +"\t從 "+ f +" 搬移到 "+t);
hanoi(n-1,u,f,t);
}
}
public static void main(String[] args) throws IOException
{
int i,k;
char f='A',u='B',t='C';
BufferedReader kb=new BufferedReader(new InputStreamReader(System.in));
String x;
System.out.println("河內塔小遊戲=========\n");
System.out.print("請輸入盤子數量:\t");
x=kb.readLine(); k=Integer.parseInt(x); hanoi(k,f,u,t);
}
}
package P1;
import java.io.*;
public class A {
public static void hanoiTower(int dishs,int peg1,int peg2,int peg3) {
if (dishs ==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[]args){
int dish =10;
hanoiTower(dish,1,2,3);
}
}
package fg;
import java.io.*;
public class gfhf
{
public static void hanoi(int n, char f, char u, char t)
{
if (n == 1)
{
System.out.println(" Dish "+ n +"\t從 "+ f +" 搬移到 "+ t);
}
else
{
hanoi(n-1,f,t,u);
System.out.println(" Dish "+ n +"\t從 "+ f +" 搬移到 "+t);
hanoi(n-1,u,f,t);
}
}
public static void main(String[] args) throws IOException
{
int i,k;
char f='A',u='B',t='C';
BufferedReader kb=new BufferedReader(new InputStreamReader(System.in));
String x;
System.out.println("河內塔小遊戲=========\n");
System.out.print("請輸入盤子數量:\t");
x=kb.readLine(); k=Integer.parseInt(x); hanoi(k,f,u,t);
}
}
package fg;
import java.io.*;
public class gfhf
{
public static void hanoi(int n, char f, char u, char t)
{
if (n == 1)
{
System.out.println(" Dish "+ n +"\t從 "+ f +" 搬移到 "+ t);
}
else
{
hanoi(n-1,f,t,u);
System.out.println(" Dish "+ n +"\t從 "+ f +" 搬移到 "+t);
hanoi(n-1,u,f,t);
}
}
public static void main(String[] args) throws IOException
{
int i,k;
char f='A',u='B',t='C';
BufferedReader kb=new BufferedReader(new InputStreamReader(System.in));
String x;
System.out.println("河內塔小遊戲=========\n");
System.out.print("請輸入盤子數量:\t");
x=kb.readLine(); k=Integer.parseInt(x); hanoi(k,f,u,t);
}
}
package p1;
public class V1 {
static void hanoiTower(int dishs, int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package p1;
public class V1 {
static void hanoiTower(int dishs, int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class b123 {
static void hanoiTower(int dishs, int peg1, int peg2, int peg3){
if ( dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs, 1, 2, 3);
}
}
public class b123 {
static void hanoiTower(int dishs, int peg1, int peg2, int peg3){
if ( dishs==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args) {
int dishs=10;
hanoiTower(dishs, 1, 2, 3);
}
}
package pack1;
public class A1 {
static void hanoiTower(int dishs,int peg1,int peg2,int peg3){
if(dishs==1)
System.out.println("盤子從 "+peg1+"移到 "+peg3);
else{
hanoiTower(dishs-1,peg1,peg2,peg3);
System.out.println("盤子從 "+peg1+"移到 "+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
public class B9933006
{
static void hanoitower(int dishs, int peg1, int peg2, int peg3)
{
if(dishs == 1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else
{
hanoitower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoitower(dishs-1,peg2,peg1,peg3);
}
}
public static void main(String[] args)
{
int dishs=10;
hanoitower(dishs,1,2,3);
}
package pack1;
public class t1 {
static void hanoiTower (int dishs,int peg1,int peg2,int peg3 )
{
if(dishs == 1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main (String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
package pack1;
public class t1 {
static void hanoiTower (int dishs,int peg1,int peg2,int peg3 )
{
if(dishs == 1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dishs-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dishs-1,peg2,peg1,peg3);
}
}
public static void main (String[]args){
int dishs=10;
hanoiTower(dishs,1,2,3);
}
}
張貼留言