用C#程序编写出后的源码:
using System;
namespace netsafe.math
{
public class ayst
{
///
/// 问题中的所有元素
///
string[,] data= {{\"黄房子\",\"蓝房子\",\"白房子\",\"红房子\",\"绿房子\"},
{\"挪威人\",\"英国人\",\"德国人\",\"丹麦人\",\"瑞典人\"},
{\"DUNHILL\",\"PRINCE\",\"混合烟\", \"PALL MALL\",\"BLUE MASTER\"},
{\"咖 啡\",\"矿泉水\",\"茶\",\"牛奶\",\" 啤酒 \"},
{\"鱼\",\" 恐龙\",\"马\", \"鸟\",\"狗\"}};
/// /// answer用来存放答案
///
int[,] answer=new int[6, 6];
int[,] ALL=new int[6,122];
int count=1;
int nLevel = 0;
int[] List=new int[6];
public static void Main(string[] args)
{
ayst c=new ayst();
c.p(); ///生成全排列到all
c.run();
Console.Read(); /// 按任意键继续
}
void run()
{
int i1,i2,i3,i4,i5;///通过逻辑条件顺序的有效选择来优化程序
for (i1=1;i1 |