发布时间: 2012-06-20 20:37:21 作者: rapoo
C#实现 汉诺塔问题using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication6{ class Program { static void hanoi(int n, char A, char B, char C) { if (n == 1) Console.WriteLine("move disc {0} from {1} to {2}", n, A, C); else { hanoi(n - 1, A, C, B); Console.WriteLine("move disc {0} from {1} to {2}", n, A, C); hanoi(n - 1, B, A, C); } } static void Main(string[] args) { int n; Console.WriteLine("input n: \n"); n = Convert.ToInt32(Console.ReadLine()); hanoi( n, 'A', 'B', 'C'); Console.ReadKey(); } }}
一个基于asp和C#的网站已经上线为
C# 频繁向Excel表格中累加数据
C#下这种效果的注释应该如何实现
有图片做一个N皇后有关问题的网页
【叫小弟我猫爷_】Linq多字段分组.
求免费图表控件解决思路
vs2012上轮换空行的正则表达式
C# 继承WinForm 窗体控件属性不可修
COM组件是什么解决办法
怎么取出数据库某int类型的列全部之和