摘要: STL中unique函数的使用 我们都知道unique的功能是去除相邻的重复元素(只保留一个),还有一个容易忽视的特性是它并不真正把重复的元素删除,不知道这个特性用起来就会出问题。比如下面这个例子,企图输出无重复的元素,中国自学编程网,www.zxbc.cn:#include<iostream>#include<vector>#include<algorithm>#include<iterator>usingnamespacestd;intmain()...{ vector<int>ivec; copy(istream_iterato 阅读全文
posted @ 2012-10-03 00:08 cchun 阅读(255) 评论(0) 推荐(0) 编辑