Go递归实现汉诺塔 package main import "fmt" // a 是源,b 借助, c 目的长度 func tower(a, b, c string, layer int) { if layer == 1 { fmt.Println(a, "111->", c) return } // n-1 个 a 借助 c 到 b tower(a, c, b, layer-1) fmt.Println(a, "11->", c)…
using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace MyExample_Hanoi_{ class Program { static void Main(string[] args) { HanoiCalculator c = new HanoiCalculator(); Cons…