Combinations With Repetitions C#

前端 未结 2 415
粉色の甜心
粉色の甜心 2020-12-09 13:17

I need assistance with Combinations with Repetition. Have searched all over the net and although I found a few examples I can\'t understand them completely. My goal is simpl

2条回答
  •  误落风尘
    2020-12-09 13:34

     string[] items = {"1", "2", "3"};
    
    var query = from i1 in items
                from i2 in items
                from i3 in items
    
                select i1 + i2 + i3 ;
    
    
    foreach(var result in query)
        Console.WriteLine(result);
                Console.ReadKey();
    

提交回复
热议问题