日期:2014-05-17 浏览次数:20635 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int D = 3; //维度,可自定义
int[,] ary = new int[D, D];
for (int i = 0; i < D; i++)
{
for (int j = 0; j < D; j++)
{
ary[i, j] = GetTrueNum(ary, i, j, D);
Console.Write("{0}\t", ary[i, j]);
}
Console.WriteLine();
}
Console.Read();
}//end of main
private static int GetTrueNum(int[,] ary, int i, int j, int D)
{
int temp = new Random().Next(1, 8);
if (