• 大小: 0.03M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-26
  • 语言: C#
  • 标签: C#  排列  组合  

资源简介


调用示例:


//数组列表 
string[] array = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10" };
//在其中选择6个数字
int lowerIndex = 6;
var combinations = new Facet.Combinatorics.Combinations<String>(
    array, 
    lowerIndex, 
    Facet.Combinatorics.GenerateOption.WithoutRepetition
);
List<string> list = new List<string>();
foreach (IList<String> combis in combinations)
{
    string[] arr = new string[combis.Count];
    combis.CopyTo(arr,0);
    String combi = String.Join(" ",arr );
    //Console.WriteLine(combi);
    list.Add(combi);
}
//将组合结果总数以及具体值 输出
MessageBox.Show(list.Count.ToString() "\r\n" string.Join(",\r\n",list.ToArray()));



资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace TextSumProblemSample {
    static class Program {
        /// 
        /// The main entry point for the application.
        /// 

        [STAThread]
        static void Main() {
            Application.EnableVisualstyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new TextSumForm());
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1099  2008-05-14 10:55  CombinatoricsSample\CombinatoricsSample.sln
     目录           0  2008-05-16 08:37  CombinatoricsSample\TextSumProblemSample\
     目录           0  2008-05-11 12:47  CombinatoricsSample\TextSumProblemSample\bin\
     目录           0  2008-05-11 13:35  CombinatoricsSample\TextSumProblemSample\bin\Debug\
     目录           0  2008-05-24 12:00  CombinatoricsSample\TextSumProblemSample\bin\Release\
     目录           0  2008-05-11 10:52  CombinatoricsSample\TextSumProblemSample\Combinatorics\
     文件       14044  2008-04-28 11:02  CombinatoricsSample\TextSumProblemSample\Combinatorics\Combinations.cs
     文件         716  2008-04-28 11:02  CombinatoricsSample\TextSumProblemSample\Combinatorics\GenerateOption.cs
     文件        1523  2008-04-28 11:02  CombinatoricsSample\TextSumProblemSample\Combinatorics\ImetaCollection.cs
     文件       18834  2008-05-16 08:48  CombinatoricsSample\TextSumProblemSample\Combinatorics\Permutations.cs
     文件        6378  2008-04-21 21:17  CombinatoricsSample\TextSumProblemSample\Combinatorics\SmallPrimeUtility.cs
     文件       16604  2008-04-28 11:02  CombinatoricsSample\TextSumProblemSample\Combinatorics\Variations.cs
     文件        7406  2008-05-11 13:09  CombinatoricsSample\TextSumProblemSample\Facet.ico
     目录           0  2008-05-24 12:00  CombinatoricsSample\TextSumProblemSample\obj\
     目录           0  2008-05-11 13:35  CombinatoricsSample\TextSumProblemSample\obj\Debug\
     目录           0  2008-04-28 15:35  CombinatoricsSample\TextSumProblemSample\obj\Debug\Refactor\
     目录           0  2008-04-28 15:14  CombinatoricsSample\TextSumProblemSample\obj\Debug\TempPE\
     目录           0  2008-05-24 12:00  CombinatoricsSample\TextSumProblemSample\obj\Release\
     目录           0  2008-05-24 12:00  CombinatoricsSample\TextSumProblemSample\obj\Release\TempPE\
     文件         478  2008-05-11 13:15  CombinatoricsSample\TextSumProblemSample\Program.cs
     目录           0  2008-04-28 15:14  CombinatoricsSample\TextSumProblemSample\Properties\
     文件        1320  2008-04-28 15:14  CombinatoricsSample\TextSumProblemSample\Properties\AssemblyInfo.cs
     文件        2867  2008-05-11 13:15  CombinatoricsSample\TextSumProblemSample\Properties\Resources.Designer.cs
     文件        5612  2008-04-28 15:14  CombinatoricsSample\TextSumProblemSample\Properties\Resources.resx
     文件        1101  2008-05-11 13:15  CombinatoricsSample\TextSumProblemSample\Properties\Settings.Designer.cs
     文件         249  2008-04-28 15:14  CombinatoricsSample\TextSumProblemSample\Properties\Settings.settings
     文件        5191  2008-05-14 10:55  CombinatoricsSample\TextSumProblemSample\TextSumForm.cs
     文件       16930  2008-05-14 10:55  CombinatoricsSample\TextSumProblemSample\TextSumForm.Designer.cs
     文件       17425  2008-05-14 10:55  CombinatoricsSample\TextSumProblemSample\TextSumForm.resx
     文件        3783  2008-05-11 17:47  CombinatoricsSample\TextSumProblemSample\TextSumProblem.cs
     文件        3827  2008-05-11 13:15  CombinatoricsSample\TextSumProblemSample\TextSumProblemSample.csproj
............此处省略1个文件信息

评论

共有 条评论