level 9
代码:
let GetThreeNum input list =
...let listSort = list |> List.sortBy(fun x -> -x)
...Seq.distinct (
......seq {
.........for n1 in listSort do
.........for n2 in listSort do
.........for n3 in listSort do
............if n1 + n2 + n3 = input && n1 >= n2 && n2 >= n3 then yield (n1,n2,n3)
.........})
2012年06月25日 07点06分