Combinatorics.cs代码清单
using System; using System.Collections; using System.Data;
/// /// 组合数学函数集 /// public class Combinatorics { #region 公共函数
/// /// 把二维整形数组转换为数据表 /// public static DataTable TwoDemisionIntArrayToDataTable(int[, ]source) { DataTable dt = new DataTable(); DataRow dr; int i, j; int b1 = source.GetUpperBound(0), b2 = source.GetUpperBound(1); //获取二维表的各维长度
for (i = 0; i <= b1; i ++ ) //以第二维长度创建数据表的各字段 dt.Columns.Add(i.ToString(), System.Type.GetType("System.Int32"));
for (i = 0; i <= b2; i ++ ) //对各返回排列循环 |