herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
先說明一下這是後知後覺的解答,所謂後知就是股票價格已知存在陣列(清單),當然就要用迴圈練習,雙迴圈暴力解需時O(n**2),當然不用,採python單一迴圈解答「最佳股票的買賣時機#LeetCode 121 Best Time to Buy and Sell Stock」,解...
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
你會用C的算子sizeof?
-
Python CPP heap priority queue速解L eetcode 2530. Maximal Score After Applying K Operations heap/priority queue是重要的資料結構,無論是C++的std::priority_q...
-
C++ DP動態規劃解Leetcode 937 Maximum Number of Points with Cost 有些標示medium要比標示hard的問題還要難,Leetcode 1937. Maximum Number of Points with Cost,DP動態規...
66 則留言:
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); }}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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); }
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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); }
}
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);
}
}
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); }
}
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);
}
}
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);
}
}
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); }
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);}}
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); }}
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);}}
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);
}
}
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);
}
}
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);
}
}
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); }}
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); } }
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
}
}
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);}}
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);
}}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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); }
}
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); }
}
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); }
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);
}}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
}
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
}
}
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);
}
}
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);
}
}
}
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
}
}
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);
}
}
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);
}
}
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);
}
}
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
}
}
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);
}
}
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
}
}
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
}
}
張貼留言