锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久久久久久免免费精品,国产麻豆精品久久一二三,麻豆亚洲AV永久无码精品久久 http://m.shnenglu.com/inbeing/category/12596.html閰烽?/description>zh-cnSun, 20 Dec 2009 16:34:59 GMTSun, 20 Dec 2009 16:34:59 GMT60vectorhttp://m.shnenglu.com/inbeing/archive/2009/12/21/103600.html铚滆渹铚滆渹Sun, 20 Dec 2009 16:14:00 GMThttp://m.shnenglu.com/inbeing/archive/2009/12/21/103600.htmlhttp://m.shnenglu.com/inbeing/comments/103600.htmlhttp://m.shnenglu.com/inbeing/archive/2009/12/21/103600.html#Feedback0http://m.shnenglu.com/inbeing/comments/commentRss/103600.htmlhttp://m.shnenglu.com/inbeing/services/trackbacks/103600.html#include <vector>
#include 
<string>
#include 
<algorithm>
#include 
<iterator>
#include 
<iostream.h>
// #include <iostream>

class GreaterThan {
public:
    GreaterThan( 
int size = 6 ) : _size( size ){}
    
int size() { return _size; }

    
bool operator()(const string & s1) {
        
return s1.size() > 6;
        }

private:
    
int _size;
};

template 
<class Type>
class PrintElem {
public:
    
void operator()( const Type &elem ) 
    {
        
++_cnt;
        
if ( _cnt % 8 == 0 ) { cout << endl; }
        cout 
<< elem << " ";
    }
    
private:
    
static int _cnt;
};

template 
< class Type >
       
int PrintElem<Type>::_cnt = 0;

class LessThan {
public:
    
bool operator()(const string & s1, const string & s2 ) {
         
return s1.size() < s2.size();
        }
};

typedef vector
<string, allocator> textwords;

void process_vocab( vector<textwords, allocator> *pvec )
{
    
if ( ! pvec ) 
         
// issue warning message
         return;

    vector
< string, allocator > texts; 

    vector
<textwords, allocator>::iterator iter = pvec->begin();
    
for ( ; iter != pvec->end(); ++iter )
              copy( (
*iter).begin(), (*iter).end(), back_inserter( texts ));

    
// sort the elements of texts
    sort( texts.begin(), texts.end() );
    for_each( texts.begin(), texts.end(), PrintElem
<string>() );

    cout 
<< endl << endl;

    
// delete all duplicate elements 
    vector<string, allocator>::iterator it;
    it 
= unique( texts.begin(), texts.end() );
    texts.erase( it, texts.end() );
    for_each( texts.begin(), texts.end(), PrintElem
<string>() );

    cout 
<< endl << endl;

    stable_sort( texts.begin(), texts.end(), LessThan() );
    for_each( texts.begin(), texts.end(), PrintElem
<string>() );

    cout 
<< endl << endl;

    
// count number of strings greater than length 6
    int cnt = 0;

    
// obsolete form of count -- standard changes this
    count_if( texts.begin(), texts.end(), GreaterThan(), cnt );

    cout 
<< "Number of words greater than length six are "
             
<< cnt << endl;

    
// 

    
static string rw[] = { "and""if""or""but""the" };
    vector
<string,allocator> remove_words( rw, rw+5 );

    vector
<string, allocator>::iterator it2 = remove_words.begin();
    
for ( ; it2 != remove_words.end(); ++it2 ) {
        
int cnt = 0;
        
// obsolete form of count -- standard changes this
            count( texts.begin(), texts.end(), *it2, cnt );
    
        cout 
<< cnt << " instances removed:  " 
                 
<< (*it2) << endl;
    
            texts.erase(
                remove(texts.begin(),texts.end(),
*it2),
                texts.end()
           );
       }

    cout 
<< endl << endl;
    for_each( texts.begin(), texts.end(), PrintElem
<string>() );
}

typedef vector
<string,allocator>::difference_type diff_type;
#include 
<fstream.h>

main()
{
     vector
<textwords, allocator> sample;
     vector
<string,allocator>       t1, t2; 
     
string               t1fn, t2fn;

     cout 
<< "text file #1: "; cin >> t1fn;
     cout 
<< "text file #2: "; cin >> t2fn;

     ifstream infile1( t1fn.c_str());
     ifstream infile2( t2fn.c_str());

     istream_iterator
< string, diff_type > input_set1( infile1 ), eos; 
     istream_iterator
< string, diff_type > input_set2( infile2 );

     copy( input_set1, eos, back_inserter( t1 ));
     copy( input_set2, eos, back_inserter( t2 ));

     sample.push_back( t1 ); sample.push_back( t2 );
     process_vocab( 
&sample );
}


铚滆渹 2009-12-21 00:14 鍙戣〃璇勮
]]>
久久久精品国产免大香伊 | 久久精品国产色蜜蜜麻豆| 26uuu久久五月天| 久久这里的只有是精品23| 久久国语露脸国产精品电影| 久久99精品久久只有精品| 久久人妻少妇嫩草AV无码专区 | 久久久久久久久久久久久久| 偷偷做久久久久网站| 久久国产乱子伦免费精品| 久久天天躁狠狠躁夜夜av浪潮| 午夜福利91久久福利| 久久99国产综合精品| 色悠久久久久久久综合网| 九九久久99综合一区二区| 久久91这里精品国产2020| 久久精品人人做人人爽电影蜜月| 大蕉久久伊人中文字幕| 亚洲香蕉网久久综合影视 | 久久久久亚洲AV综合波多野结衣| 久久99九九国产免费看小说| 久久久久人妻一区精品性色av| 久久精品国产精品亚洲艾草网美妙| 久久人人爽人人人人片av| 国产精品久久久99| 久久久久人妻精品一区| 中文字幕热久久久久久久| 91久久精品视频| 97精品久久天干天天天按摩| 亚洲伊人久久大香线蕉综合图片 | 精品综合久久久久久97| 久久久久久毛片免费看| 精品久久久无码中文字幕天天| 亚洲第一极品精品无码久久| 国产69精品久久久久9999| 久久狠狠色狠狠色综合| 久久久久亚洲av无码专区| 69国产成人综合久久精品| 国内精品久久久久久99| 久久精品嫩草影院| 国产L精品国产亚洲区久久 |