herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (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也不例...
-
2 pointer Python C++解Leetcode 3163 String Compression III [codes on Leetcode] https://leetcode.com/problems/string-compression-iii/solution...
68 則留言:
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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,peg3,peg1);
}
}
public static void main (String[]args){
int dishs = 3;
hanoiTower(dishs,1,2,3);
}
}
package p1;
import java.util.*;
public class aa
{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
package p1;
import java.util.*;
public class hw1
{
static void HT(int d,int p1,int p2,int p3)
{
if(d==1)
System.out.println("盤子從"+p1+"移到"+p3);
else
{
HT(d-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移到"+p3);
HT(d-1,p2,p1,p3);
}
}
public static void main(String[]args)
{
Scanner sc=new Scanner(System.in);
int d=sc.nextInt();
HT(d,1,2,3);
}
}
import java.util.*;
public class b10033057 {
static void hanoiTower(int dish,int peg1,int peg2,int peg3)
{
if (dish ==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dish-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dish=1,peg2,peg1,peg3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
import java.util.*;
public class B10033020
{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
import java.util.*;
public class B10033045
{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
public class koo {
static void hanoiTower(int dish, int peg1, int peg2, int peg3){
if ( dish == 1)
System.out.println("盤子從 "+peg1+"移到 "+peg3);
else {
hanoiTower(dish-1,peg1,peg3,peg2);
System.out.println("盤子從 "+peg1+"移到 "+peg3);
hanoiTower(dish-1,peg2,peg1,peg3);
}
}
public static void main(String[] args){
int dish = 3;
hanoiTower(dish, 1, 2, 3);
}
}
import java.util.*;
public class B10033044
{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
public class java {
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 = 3;
hanoiTower(dishs, 1,2,3);
}
}
public class Java {
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 =3;
hanoiTower(dish,1,2,3);
}
}
public class test
{
static int count=0;
public static void main(String[] args )
{
towerofHanoi (20,'A','B','C');
System.out.println ("The tatal number of steps is" +count);
}
static void towerofHanoi ( int dishes,char from,char by,char to)
{
if(dishes==1)
{
System.out.print (" 盤子從 "+from);
System.out.println (" 移到 "+to);
count++;
}
else
{
towerofHanoi (dishes-1,from,to,by);
System.out.print (" 盤子從 "+from);
System.out.println (" 移到 "+to);
count++;
towerofHanoi ( dishes-1,by,from,to);
}
}
}
public class hekko {
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=3;
hanoiTower(dishs,1,2,3);
}
}
public class b16 {
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=3;
hanoiTower(dishs,1,2,3);
}
}
B9733002鍾志捷
public class Java {
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 =3;
hanoiTower(dish,1,2,3);
}
}
public class yano {
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=3;
hanoiTower(dishs,1,2,3);
}
}
import java.util.*;
public class B10033004
{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
import java.util.*;
public class B10033056
{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
import java.util.*;
public class test
{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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,peg3,peg1);
}
}
public static void main (String[]args){
int dishs = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello {
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class aa {
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=3;
hanoiTower(dishs,1,2,3);
}
}
public static void main(String[]args){
int dishs = 3;
hanoiTower(dishs,1,2,3);
}
}
public class h{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
import java.util.*;
public class B9833084
{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
import java.util.*;
public class b10033009 {
static void hanoiTower(int dish,int peg1,int peg2,int peg3)
{
if (dish ==1)
System.out.println("盤子從"+peg1+"移到"+peg3);
else{
hanoiTower(dish-1,peg1,peg3,peg2);
System.out.println("盤子從"+peg1+"移到"+peg3);
hanoiTower(dish=1,peg2,peg1,peg3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class NYPD{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
import java.util.*;
public class B10033035{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
public class koo {
static void hanoiTower(int dish, int peg1, int peg2, int peg3){
if ( dish == 1)
System.out.println("盤子從 "+peg1+"移到 "+peg3);
else {
hanoiTower(dish-1,peg1,peg3,peg2);
System.out.println("盤子從 "+peg1+"移到 "+peg3);
hanoiTower(dish-1,peg2,peg1,peg3);
}
}
public static void main(String[] args){
int dish = 3;
hanoiTower(dish, 1, 2, 3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
import java.util.*;
public class B9833151
{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class b16 {
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=3;
hanoiTower(dishs,1,2,3);
}
}
public class hekko {
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=3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
package p1;
import java.util.*;
public class shao
{
private static Scanner sc;
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
sc = new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
package p1;
import java.util.*;
public class hi123
{
private static Scanner sc;
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
sc = new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class jas{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class koo {
static void hanoiTower(int dish, int peg1, int peg2, int peg3){
if ( dish == 1)
System.out.println("盤子從 "+peg1+"移到 "+peg3);
else {
hanoiTower(dish-1,peg1,peg3,peg2);
System.out.println("盤子從 "+peg1+"移到 "+peg3);
hanoiTower(dish-1,peg2,peg1,peg3);
}
}
public static void main(String[] args){
int dish = 3;
hanoiTower(dish, 1, 2, 3);
}
}
public class hello{
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,peg3,peg1);
}
}
public static void main (String[]args){
int dishs = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class java {
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 = 3;
hanoiTower(dishs, 1,2,3);
}
}
public class hello{
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,peg3,peg1);
}
}
public static void main (String[]args){
int dishs = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class abc {
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=3;
hanoiTower(dishs,1,2,3);
}
}
public class b10033029 {
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=3;
hanoiTower(dishs,1,2,3);
}
}
import java.util.*;
public class B10033040
{
static void hanoiTower(int dishs,int p1,int p2,int p3)
{
if (dishs==1)
System.out.println("盤子從"+p1+"移動到"+p3);
else{
hanoiTower(dishs-1,p1,p3,p2);
System.out.println("盤子從"+p1+"移動到"+p3);
hanoiTower(dishs-1,p2,p1,p3);
}
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.print("請輸入盤數:");
int dishs=sc.nextInt();
hanoiTower(dishs,1,2,3);
}
}
B10033028 劉名翔
public class hello{
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,peg3,peg1);
}
}
public static void main (String[]args){
int dishs = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
public class hello{
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 = 3;
hanoiTower(dishs,1,2,3);
}
}
張貼留言