• 大小: 0.02M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: 算法  C#  组合  排列  

资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main()
        {
            string[] arr = new string[] { “a“ “b“ “c“ “d“ “e“ };
            List list = new List();
            foreach (string s in arr)
            {
                List lst = list.GetRange(0 list.Count);
                string[] nArr = { s };
                list.Add(nArr);
                foreach (string[] ss in lst)
                {
                    list.Add(ss.Concat(nArr).ToArray());
                }
            }
            List outList = list.OrderByDescending(p => p.Length).ToList();
            outList.ForEach(p => Console.WriteLine(string.Join(““ p)))

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-02 00:34  ConsoleApp1\
     文件         178  2018-12-02 00:31  ConsoleApp1\ConsoleApp1.csproj
     文件        1716  2018-12-02 00:34  ConsoleApp1\Program.cs
     目录           0  2018-12-02 00:31  ConsoleApp1\bin\
     目录           0  2018-12-02 00:31  ConsoleApp1\bin\Debug\
     目录           0  2018-12-02 00:32  ConsoleApp1\bin\Debug\netcoreapp2.1\
     文件         465  2018-12-02 00:31  ConsoleApp1\bin\Debug\netcoreapp2.1\ConsoleApp1.deps.json
     文件        5632  2018-12-02 00:32  ConsoleApp1\bin\Debug\netcoreapp2.1\ConsoleApp1.dll
     文件         876  2018-12-02 00:32  ConsoleApp1\bin\Debug\netcoreapp2.1\ConsoleApp1.pdb
     文件         252  2018-12-02 00:32  ConsoleApp1\bin\Debug\netcoreapp2.1\ConsoleApp1.runtimeconfig.dev.json
     文件         154  2018-12-02 00:32  ConsoleApp1\bin\Debug\netcoreapp2.1\ConsoleApp1.runtimeconfig.json
     目录           0  2018-12-02 00:31  ConsoleApp1\obj\
     文件         149  2018-12-02 00:31  ConsoleApp1\obj\ConsoleApp1.csproj.nuget.cache
     文件        1587  2018-12-02 00:31  ConsoleApp1\obj\ConsoleApp1.csproj.nuget.g.props
     文件         981  2018-12-02 00:31  ConsoleApp1\obj\ConsoleApp1.csproj.nuget.g.targets
     目录           0  2018-12-02 00:31  ConsoleApp1\obj\Debug\
     目录           0  2018-12-02 00:32  ConsoleApp1\obj\Debug\netcoreapp2.1\
     文件        1016  2018-12-02 00:31  ConsoleApp1\obj\Debug\netcoreapp2.1\ConsoleApp1.AssemblyInfo.cs
     文件          42  2018-12-02 00:31  ConsoleApp1\obj\Debug\netcoreapp2.1\ConsoleApp1.AssemblyInfoInputs.cache
     文件       20697  2018-12-02 00:31  ConsoleApp1\obj\Debug\netcoreapp2.1\ConsoleApp1.assets.cache
     文件          42  2018-12-02 00:31  ConsoleApp1\obj\Debug\netcoreapp2.1\ConsoleApp1.csproj.CoreCompileInputs.cache
     文件         980  2018-12-02 00:32  ConsoleApp1\obj\Debug\netcoreapp2.1\ConsoleApp1.csproj.FileListAbsolute.txt
     文件        5632  2018-12-02 00:32  ConsoleApp1\obj\Debug\netcoreapp2.1\ConsoleApp1.dll
     文件         876  2018-12-02 00:32  ConsoleApp1\obj\Debug\netcoreapp2.1\ConsoleApp1.pdb
     文件           0  2018-12-02 00:31  ConsoleApp1\obj\Debug\netcoreapp2.1\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
     文件           0  2018-12-02 00:31  ConsoleApp1\obj\Debug\netcoreapp2.1\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
     文件           0  2018-12-02 00:31  ConsoleApp1\obj\Debug\netcoreapp2.1\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
     文件       39513  2018-12-02 00:31  ConsoleApp1\obj\project.assets.json
     文件        1132  2018-12-02 00:31  ConsoleApp1.sln

评论

共有 条评论