日期:2014-05-17 浏览次数:20802 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int n = 3;
string[] are = { "1", "2", "3", "4", "5", "6" };
var result = are.Select(x => new string[] { x });
for (int i = 0; i < n - 1; i++)
{
result = result.SelectMany(x => are.Where(y => y.CompareTo(x.First()) < 0).Select(y => new string[] { y }.Concat(x).ToArray()));
}
foreach (var item in result)