herrDeng網內搜尋

自訂搜尋

Ads

2015年12月1日 星期二

ex6 河內塔

河內塔

66 則留言:

B10333107-曾詠浩 提到...

package b10333107;

public class hw1 { static int count=0; static void hanoiTower(int n,int p1,int p2,int p3){ if(n ==1) System.out.println((++count)+":Disk "+n+" from"+p1+" to "+p3); else { hanoiTower(n-1, p1, p2, p3); System.out.println((++count)+":Disk "+n+" from"+p1+" to "+p3); hanoiTower(n-1, p1, p2, p3); }} public static void main(String[] args) { hanoiTower(4,1,2,3); }}

B10333070 徐承瑋 提到...



public class hw1 { static int count=0; static void HanoiTower(int n,int t1, int t2, int t3){ if(n==1) System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); else { HanoiTower(n-1,t1,t3,t2); System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); HanoiTower(n-1,t2,t1,t3); } }

public static void main(String[] args) { HanoiTower(4,1,2,3);

}

}

B10333104郭杰哲 提到...


public class text_1 { static int count=0; static void hanoiTower(int n, int p1,int p2,int p3) { if(n==1) System.out.println((++count)+":Dick "+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p2,p3); System.out.println((++count)+":Dick "+n+"from"+p1+"to"+p3); hanoiTower(n-1,p1,p2,p3); } }
public static void main(String[] args) { // TODO Auto-generated method stub hanoiTower(4,1,2,3);
}
}

B10333061陳柏諺 提到...

package hw1;

public class p1 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk "+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } }

public static void main(String[] args) { hanoiTower(4,1,2,3);

}

}

B10333082吳樹凱 提到...

package hw1;

public class p1 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk "+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } }

public static void main(String[] args) { hanoiTower(4,1,2,3);

}

}

匿名 提到...


public class ex1 {
static int count=0;
static void hanoiTower(int n, int p1, int p2, int p3){
if(n==1)
System.out.println((++count)+":Disk"+n+" from"+p1+"to"+p3);
else
{
hanoiTower(n-1,p1,p3,p2);
System.out.println((++count)+":Disk"+n+" from"+p1+"to"+p3);
}
}
public static void main(String[] args) {
hanoiTower(4,1,2,3);


}

}

B10333106劉郁芃 提到...

public class ex1 { static int count=0; static void hanoiTower(int n,int p1,int p2,int p3){ if(n==1) System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); hanoiTower(n-1,p2,p1,p3); } } public static void main(String[] args) { hanoiTower(4,1,2,3); }

}

B10333086 陳晏堂 提到...

package w1;
public class w1 {
static int count=0;
static void hanoiTower(int n,int p1,int p2,int p3)
{
if(n==1)
System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3);
else
{
hanoiTower(n-1,p1,p3,p2);
System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3);
hanoiTower(n-1,p2,p1,p3);
}
}

public static void main(String[] args) {
hanoiTower(4,1,2,3);

}

}

B103 提到...

public class ex1{ static int count=0; static void hanoiTower(int n,int p1, int p2,int p3) { if(n==1) System.out.println((++count)+":Disk"+"form"+p1+"to"+p3 ); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+"form"+p1+"to"+p3 ); hanoiTower(n-1,p2,p1,p3); } } public static void main(String[] args){ hanoiTower(4,1,2,3);

}

}

B10333086 陳晏堂 提到...

package w1;
public class w1 {
static int count=0;
static void hanoiTower(int n,int p1,int p2,int p3)
{
if(n==1)
System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3);
else
{
hanoiTower(n-1,p1,p3,p2);
System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3);
hanoiTower(n-1,p2,p1,p3);
}
}

public static void main(String[] args) {
hanoiTower(4,1,2,3);

}

}

B10236116 許誌文 提到...

public class ex1 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); else { hanoiTower(n-1 , p1, p3, p2); System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); hanoiTower(n-1, p2, p1, p3); } }

public static void main(String[] args) { hanoiTower(4, 1, 2, 3);

}

}

B10333083,周琬芸 提到...

public class ex1{ static int count=0; static void hanoiTower(int n,int p1, int p2,int p3) { if(n==1) System.out.println((++count)+":Disk"+"form"+p1+"to"+p3 ); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+"form"+p1+"to"+p3 ); hanoiTower(n-1,p2,p1,p3); } } public static void main(String[] args){ hanoiTower(4,1,2,3);

}

}

b10333102三于婷 提到...

public class hw1 { static int count=0; static void hanoiTower(int n,int p1,int p2,int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } } public static void main(String[] args) { hanoiTower(4,1,2,3);

}

}

B10333107-曾詠浩 (訂正版) 提到...

package b10333107; public class hw1 { static int count=0; static void hanoiTower(int n,int p1,int p2,int p3) { if(n ==1) System.out.println((++count)+":Disk "+n+" from"+p1+" to "+p3); else { hanoiTower(n-1, p1, p3, p2); System.out.println((++count)+":Disk "+n+" from"+p1+" to "+p3); hanoiTower(n-1, p2, p1, p3); } } public static void main(String[] args) { hanoiTower(4,1,2,3); } }

匿名 提到...


public class ex1 {
static int count=0;
static void hanoiTower(int n, int p1, int p2, int p3){
if(n==1)
System.out.println((++count)+":Disk"+n+" from"+p1+"to"+p3);
else
{
hanoiTower(n-1,p1,p3,p2);
System.out.println((++count)+":Disk"+n+" from"+p1+"to"+p3);
}
}
public static void main(String[] args) {
hanoiTower(4,1,2,3);


}

}

B10333066周政霆 提到...

public class ex1 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); hanoiTower(n-1,p2,p1,p3); } } public static void main(String[] args) { hanoiTower(4,1,2,3); }

}

B10333085 提到...



public class hanoitower { static int count=0; static void hanoitower(int n,int p1,int p2,int p3){ if (n==1) System.out.println((++count)+":"+n+"從"+p1+"到"+p3); else { hanoitower(n-1,p1,p3,p2); System.out.println((++count)+":"+n+"從"+p1+"到"+p3); hanoitower(n-1,p2,p1,p3); } } public static void main(String[] args) { hanoitower(4,1,2,3);

}

}

B10333103 提到...

public class ex1 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk"+n+" from"+p1+" to "+p3); else { hanoiTower(n-1,p1,p3, p2); System.out.println((++count)+":Disk"+n+" from "+p1+" to "+p3); hanoiTower(n-1,p2,p1, p3); } }

public static void main(String[] args) { // TODO Auto-generated method stub hanoiTower(4, 1, 2, 3); }

}

B10333089游智翔 提到...

package p1;

public class hw1 {
static int count=0;
static void hanoiTower(int n , int p1 ,int p2, int p3){
if(n==1)
System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3);
else
{
hanoiTower(n-1,p1,p2,p3);
System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3);
hanoiTower(n-1,p1,p2,p3);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
hanoiTower(4, 1, 2, 3);

}

}

b1033 提到...

package b10333079;

public class ex1 {static int count=0;static void xxx(int n , int p1 , int p2 , int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { xxx(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); xxx(n-1,p2,p1,p3); }} public static void main(String[] args) { xxx(4,1,2,3);

}

}

b10333094張之銜 提到...

package p1; public class hw1 { static int count=0; static void yyy(int n, int p1, int p2, int p3) { if(n==1) System.out.println((++count)+":Disk "+n+" from"+p1+" to "+p3); else { yyy(n-1, p1, p3, p2); System.out.println((++count)+":Disk "+n+" from"+p1+" to "+p3); yyy(n-1,p2,p1, p3); } } public static void main(String[] args) { // TODO Auto-generated method stub yyy(4,1,2,3); }

}

b10333079 葉禮魁 提到...

package b10333079;

public class ex1 {static int count=0;static void xxx(int n , int p1 , int p2 , int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { xxx(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); xxx(n-1,p2,p1,p3); }} public static void main(String[] args) { xxx(4,1,2,3);

}

}

B10333055翁恩義 提到...

public class ex1 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); else { hanoiTower(n-1, p1, p3, p2); System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); hanoiTower(n-1, p2, p1, p3); } } public static void main(String[] args) { hanoiTower(4, 1, 2, 3);

}

}

b10333060 提到...

public class EX1 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk " +n+ " from "+p1+" to "+p3); else { hanoiTower(n-1, p1 , p3 , p2); System.out.println((++count)+":Disk " +n+ " from "+p1+" to "+p3); hanoiTower(n-1, p2 , p1 , p3); } }
public static void main(String[] args) { hanoiTower(4 , 1 , 2 , 3);
}
}

B10333072黃玟茜_資管二乙 提到...

package hw2;

public class p1 { static int count=0; static void hanoiTower(int n,int p1,int p2,int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } }

public static void main(String[] args) { hanoiTower(4,1,2,3);

}

}

B10333087 蔡銘家 提到...

package hw1;public class ex1 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+"from"+p1+" to "+p3); else { hanoiTower(n-1, p1, p3, p2); System.out.println((++count)+":Disk "+n+"from"+p1+" to "+p3); hanoiTower(n-1, p2, p1, p3); } } public static void main(String[] args) { hanoiTower(4, 1, 2, 3);

}

}

B10333058黃永祥 提到...



public class ex1 {static int count=0;static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); else {hanoiTower(n-1, p2, p1, p2); System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3);hanoiTower(n-1, p2, p1, p3);}}public static void main(String[] args) { hanoiTower(4, 1, 2, 3);}}

B10333097胡聖恩 提到...



public class ex1 { static int count=0; static void hanoiTower(int n,int p1,int p2,int p3) { if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } } public static void main(String[] args) { hanoiTower(4,1,2,3); }}

B10333092黃星維 提到...



public class ex1 {static int count=0;static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); else {hanoiTower(n-1, p2, p1, p2); System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3);hanoiTower(n-1, p2, p1, p3);}}public static void main(String[] args) { hanoiTower(4, 1, 2, 3);}}

B10333059 提到...

package p1;public class hw1 { static int count=0; static void HanoiTower(int n,int t1, int t2, int t3){ if(n==1) System.out.println((++count)+":Dish "+n+" From "+t1+" To "+t3); else { HanoiTower(n-1,t1,t3,t2); System.out.println((++count)+":Dish "+n+" From "+t1+ " To "+t3); HanoiTower(n-1,t2,t1,t3); } }

public static void main(String[] args) { HanoiTower(4,1,2,3);

}

}

B10333069 提到...

public class test1 {
static int count=0;
static void hanoiTower(int n, int p1,int p2, int p3){
if(n==1)
System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3);
else
{
hanoiTower(n-1,p1,p3, p2);
System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3);
hanoiTower(n-1,p2,p1, p3);
}
}

public static void main(String[] args) {
// TODO Auto-generated method stub
hanoiTower(4,1,2,3);
}

}

b10333080王育文 提到...

public class ex1 { static int count=0; static void hanoiTower(int n,int p1,int p2,int p3) { if(n==1) System.out.println((++count)+":"+"盤"+n+" from "+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":"+"盤"+n+" from "+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } } public static void main(String[] args) { hanoiTower(4,1,2,3);

}

}

B10333090廖偉翔 提到...

package p;

public class q {

static int count=0;static void hanoiTower(int n, int p1,int p2,int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); }}public static void main(String[] args) { hanoiTower(4,1,2,3); }}

B10333100李禹範 提到...

public class W1 { static int count=0; static void hanoiTower(int n,int p1,int p2,int p3) { if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } } public static void main(String[] args) { // TODO Auto-generated method stub hanoiTower(4,1,2,3); } }

b10333063羅胤銓 提到...

package zxc;public class adf { static int count=0; static void hanoiTower(int n, int p1,int p2,int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); }} public static void main(String[] args) { hanoiTower(4,1,2,3); // TODO Auto-generated method stub

}

}

B10333098蔡紹威 提到...



public class ex1 {static int count=0;static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); else {hanoiTower(n-1, p2, p1, p2); System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3);hanoiTower(n-1, p2, p1, p3);}}public static void main(String[] args) { hanoiTower(4, 1, 2, 3);}}

B10333057楊嘉昀 提到...

package b10333057;

public class a1 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1, p1 ,p3 ,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); hanoiTower(n-1, p2 ,p1 ,p3); } }

public static void main(String[] args) { hanoiTower(4,1,2,3);

}}

B10333077潘家銘 提到...

package h1;

public class w1 {

static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+" from"+p1+" to "+p3); else { hanoiTower(n-1, p1, p3, p2); System.out.println((++count)+":Disk "+n+" from"+p1+" to "+p3); hanoiTower(n-1, p2, p1, p3); } } public static void main(String[] args) { hanoiTower(4, 1, 2, 3);

}

}

林羿君B10333109 提到...

package h1;

public class p1 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1, p1, p3, p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); hanoiTower(n-1, p2, p1, p3); } }

public static void main(String[] args) { hanoiTower(4, 1, 2, 3);

}

}

B10333062邱鐠生 提到...

package p1;

public class hw1 { static int count=0; static void hanoiTower(int n , int p1 ,int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); else { hanoiTower(n-1,p1,p2,p3); System.out.println((++count)+":Disk "+n+" from "+p1+" to "+p3); hanoiTower(n-1,p1,p2,p3); } } public static void main(String[] args) { // TODO Auto-generated method stub hanoiTower(4, 1, 2, 3);

}

}

B10333168 楊君堯 提到...

public class ex1 {
static int count=0;
static void hanoiTower(int n, int p1, int p2, int p3){
if(n==1)
System.out.println((++count)+":Disk"+n+" from"+p1+"to"+p3);
else
{
hanoiTower(n-1,p1,p3,p2);
System.out.println((++count)+":Disk"+n+" from"+p1+"to"+p3);
}
}
public static void main(String[] args) {
hanoiTower(4,1,2,3);


}

}

B10333172黃緯豪 提到...

public class ex1 {
static int count=0;
static void hanoiTower(int n, int p1, int p2, int p3){
if(n==1)
System.out.println((++count)+":Disk"+n+" from"+p1+"to"+p3);
else
{
hanoiTower(n-1,p1,p3,p2);
System.out.println((++count)+":Disk"+n+" from"+p1+"to"+p3);
}
}
public static void main(String[] args) {
hanoiTower(4,1,2,3);


}

}

B10333168楊君堯 提到...

public class ex1 {
static int count=0;
static void hanoiTower(int n, int p1, int p2, int p3){
if(n==1)
System.out.println((++count)+":Disk"+n+" from"+p1+"to"+p3);
else
{
hanoiTower(n-1,p1,p3,p2);
System.out.println((++count)+":Disk"+n+" from"+p1+"to"+p3);
}
}
public static void main(String[] args) {
hanoiTower(4,1,2,3);


}

}

王舒瑄b10333067 提到...



public class P1 {static int count=0;static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1)System.out.println((++count)+":Disk "+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk "+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); }} public static void main(String[] args) { hanoiTower(4,1,2,3); }

}

b10333088 提到...

package p1;public class test1{ static int count=0;static void hanoiTower(int n ,int p1 ,int p2 ,int p3) { if (n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); }}

public static void main(String[] args) { hanoiTower(4,1,2,3); }

}

B10333108莊祐瑋 提到...



public class ex1 { static int count=0; static void hanoiTower(int n,int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); } } public static void main(String[] args) { hanoi Tower(4,1,2,3);

}

紀虹汝 提到...

public class ex1 { static int count=0; static void hanoiTower(int n,int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); } } public static void main(String[] args) { hanoi Tower(4,1,2,3); }

B10333075曾敬堯 提到...

public class text1 { static int count=0; static void hanoiTower(int n,int p1,int p2,int p3){ if(n==1) System.out.println((++count)+"Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+"Disk"+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } } public static void main(String[] args) {hanoiTower(4,1,2,3);

}}

B10333065 林雨婷 提到...



public class EX01 {static int count=0;static void hanoiTower(int n, int p1, int p2,int p3){ if(n==1) System.out.println((+count)+":Disk"+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); }} public static void main(String[] args) { hanoiTower(4,1,2,2);

}

}

張鈞閔 提到...

public class W1
{
static int count=0;
static void hanoiTower(int n,int p1,int p2,int p3)
{
if(n==1)
System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3);
else
{
hanoiTower(n-1,p1,p3,p2);
System.out.println((++count)+":Disk"+n+"from"+p1+"to"+p3);
hanoiTower(n-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
hanoiTower(4,1,2,3);
}

}

B10333081 提到...

public class ex1 { static int count=0; static void hanoiTower(int n,int p1,int p2,int p3) { if(n==1) System.out.println((++count)+":"+"盤"+n+" from "+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":"+"盤"+n+" from "+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } } public static void main(String[] args) { hanoiTower(4,1,2,3);

}

}

B10333073湯宇謙 提到...

public class hw1 { static int count=0; static void HanoiTower(int n,int t1, int t2, int t3){ if(n==1) System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); else { HanoiTower(n-1,t1,t3,t2); System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); HanoiTower(n-1,t2,t1,t3); } }

public static void main(String[] args) { HanoiTower(4,1,2,3);

}

}

B10333073湯宇謙 提到...

public class hw1 { static int count=0; static void HanoiTower(int n,int t1, int t2, int t3){ if(n==1) System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); else { HanoiTower(n-1,t1,t3,t2); System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); HanoiTower(n-1,t2,t1,t3); } }

public static void main(String[] args) { HanoiTower(4,1,2,3);

}

}

B10333073湯宇謙 提到...

public class hw1 { static int count=0; static void HanoiTower(int n,int t1, int t2, int t3){ if(n==1) System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); else { HanoiTower(n-1,t1,t3,t2); System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); HanoiTower(n-1,t2,t1,t3); } }

public static void main(String[] args) { HanoiTower(4,1,2,3);

}

}

b10333064 提到...

public class hw1 { static int count=0; static void HanoiTower(int n,int t1, int t2, int t3){ if(n==1) System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); else { HanoiTower(n-1,t1,t3,t2); System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); HanoiTower(n-1,t2,t1,t3); } }

public static void main(String[] args) { HanoiTower(4,1,2,3);

}

}
}

B20曹正諭 提到...

package zxc;public class adf { static int count=0; static void hanoiTower(int n, int p1,int p2,int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); }} public static void main(String[] args) { hanoiTower(4,1,2,3); // TODO Auto-generated method stub



}



}

B10333089游智翔 提到...

public class hw1 { static int count=0; static void HanoiTower(int n,int t1, int t2, int t3){ if(n==1) System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); else { HanoiTower(n-1,t1,t3,t2); System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); HanoiTower(n-1,t2,t1,t3); } }

public static void main(String[] args) { HanoiTower(4,1,2,3);

}

}

B10333089游智翔 提到...

public class hw1 { static int count=0; static void HanoiTower(int n,int t1, int t2, int t3){ if(n==1) System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); else { HanoiTower(n-1,t1,t3,t2); System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); HanoiTower(n-1,t2,t1,t3); } }

public static void main(String[] args) { HanoiTower(4,1,2,3);

}

}
}

B10333081曹正諭 提到...

package zxc;public class adf { static int count=0; static void hanoiTower(int n, int p1,int p2,int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); }} public static void main(String[] args) { hanoiTower(4,1,2,3); // TODO Auto-generated method stub



}



}

b10333093 徐子軒 提到...



package b10333093;

public class ex4 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk "+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } }

public static void main(String[] args) { hanoiTower(4,1,2,3);

}

}

A10433011 提到...

package b10333093;

public class ex4 { static int count=0; static void hanoiTower(int n, int p1, int p2, int p3){ if(n==1) System.out.println((++count)+":Disk "+n+"from"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk "+n+"from"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); } }

public static void main(String[] args) { hanoiTower(4,1,2,3);

}

}

B10333101游承浩 提到...

public class hw1 { static int count=0; static void HanoiTower(int n,int t1, int t2, int t3){ if(n==1) System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); else { HanoiTower(n-1,t1,t3,t2); System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); HanoiTower(n-1,t2,t1,t3); } }

public static void main(String[] args) { HanoiTower(4,1,2,3);

}

}

B10333071廖智加 提到...

package zxc;public class adf { static int count=0; static void hanoiTower(int n, int p1,int p2,int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); }} public static void main(String[] args) { hanoiTower(4,1,2,3); // TODO Auto-generated method stub



}



}

林羿君 B10333109 提到...

public class hw1 { static int count=0; static void HanoiTower(int n,int t1, int t2, int t3){ if(n==1) System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); else { HanoiTower(n-1,t1,t3,t2); System.out.println((++count)+":Dish"+n+"From"+t1+"To"+t3); HanoiTower(n-1,t2,t1,t3); } }



public static void main(String[] args) { HanoiTower(4,1,2,3);



}



}

B10333071廖智加 提到...

package zxc;public class adf { static int count=0; static void hanoiTower(int n, int p1,int p2,int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); }} public static void main(String[] args) { hanoiTower(4,1,2,3); // TODO Auto-generated method stub



}



}

B10333071廖智加 提到...

package zxc;public class adf { static int count=0; static void hanoiTower(int n, int p1,int p2,int p3){ if(n==1) System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); else { hanoiTower(n-1,p1,p3,p2); System.out.println((++count)+":Disk"+n+"form"+p1+"to"+p3); hanoiTower(n-1,p2,p1,p3); }} public static void main(String[] args) { hanoiTower(4,1,2,3); // TODO Auto-generated method stub



}



}

Related Posts Plugin for WordPress, Blogger...

熱門文章