set_intersection使用详解
set_intersection()作用是求两个集合的交集,其中有5个参数:firts1,last1,first2,last2,result。他们都是迭代器。需要注意的是,所求的两个集合必须是排序之后的,不然运行时会出现错误。例子:set_intersection(nums1.begin(), nums1.end(), nums2.begin(), nums2.end(), inserter(re,re.begin()));...
原创
2020-05-17 11:59:31 ·
6580 阅读 ·
0 评论