日期:2014-05-17 浏览次数:20917 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int[][] data = new int[][]
{
new int[] { 1, 2, 3 },
new int[] { 4, 5 },
new int[] { 7, 8 },
new int[] { 9 }
};
var query = data[0].Select(x => new int[] { x });
foreach (var item in data.Skip(1))
{
query = query.SelectMany(x => item.Select(y => x.Concat(new int[] { y }).ToArray()));