小编Ram*_*mya的帖子

c#中的排列

是否可以在c#中生成集合的所有排列?

char[] inputSet = { 'A','B','C' };
Permutations<char> permutations = new Permutations<char>(inputSet);
foreach (IList<char> p in permutations)
{
   Console.WriteLine(String.Format("{{{0} {1} {2}}}", p[0], p[1], p[2]));
}
Run Code Online (Sandbox Code Playgroud)

c#

5
推荐指数
1
解决办法
2531
查看次数

标签 统计

c# ×1