STL-VECTOR
文章平均质量分 52
beecindy
hi
展开
-
erase
方法一:#include #include #include using namespace std;//bool compare(int d)//{// return d == 3;//}int main(){ vector ivec; int i; vector::iterator it; for(i = 0;i < 5;++i)原创 2009-12-13 21:36:00 · 273 阅读 · 0 评论 -
remove的问题
#include #include using namespace std; void PrintIt( char * &AString ) { cout < < AString < < endl; } int main( ) { vector Birds; vector ::iterat原创 2009-12-13 21:43:00 · 336 阅读 · 0 评论 -
stable_sort
stable_sort(vec_str.begin(),vec_str.end(), measure_compare);bool measure_compare(const node &a,const node &b){ return a.second < b.second; }原创 2009-12-16 10:13:00 · 358 阅读 · 0 评论 -
sort
#include "stdafx.h"#include #include #include using namespace std; struct AssessTypeInfo{ unsigned int m_uiType; //类型ID char m_szName[64]; //类型名称 unsigned int m_uiTotal; //总分数原创 2009-12-15 18:05:00 · 322 阅读 · 0 评论 -
count_if
int TFIDFMeasure::CountWords(string& word, const StrVec& words){ int nCount = 0; nCount = count_if(words.begin(),words.end(),WordComp(word)); return nCount;}class WordComp {public:原创 2009-12-16 10:11:00 · 343 阅读 · 0 评论 -
transform
#include #include #include #include #include using namespace std;string& toLower(string&);int main() { vector svec; svec.push_back("Stanley B. Lippman"); svec.push_back("Scott Meye原创 2009-12-16 10:24:00 · 286 阅读 · 0 评论 -
chap12
#include #include #include #include #include // #include class GreaterThan {public: GreaterThan( int size = 6 ) : _size( size ){} int size() { return _size; } bool operator()(c原创 2009-12-19 18:13:00 · 328 阅读 · 0 评论