f#set操作示例代码

代码语言:f#

所属分类:其他

代码描述:f#set操作示例代码

代码标签:

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

let a = Set.ofSeq [ 1 ..2.. 20 ]
let b = Set.ofSeq [ 1 ..3 .. 20 ]
let c = Set.intersect a b
let d = Set.union a b
let e = Set.difference a b

printfn "Set a: "
Set.iter (fun x -> printf "%O " x) a
printfn""

printfn "Set b: "
Set.iter (fun x -> printf "%O " x) b
printfn""

printfn "S.........完整代码请登录后点击上方下载按钮下载查看

网友评论0