++


         

- 4


++cnt;

// ?

if ( curLen > max )

{

max = curLen;

largest = buf;

}

}

cout << " " << cnt << endl;

cout << " " << max << endl;

cout << " " << largest << endl;

}

- . :

#include <string>

void filter_string( string &str )

{

// ,

string filt_elems( "\",?." );

string::size_type pos = 0;

while (( pos = str.find_first_of( filt_elems, pos ))

!= string::npos )

str.erase( pos, 1 );

}

, , , . , . , .

#include <string>

void filter_string( string &str,

string filt_elems = string("\",."))

{

string::size_type pos = 0;

while (( pos = str.find_first_of( filt_elems, pos ))

!= string::npos )

str.erase( pos, 1 );

}

filter_string() , , :

template <class InputIterator>

void filter_string( InputIterator first, InputIterator last,

string filt_elems = string("\",."))

{

for ( ; first != last; first++ )

{

string::size_type pos = 0;

while (( pos = (*first).find_first_of( filt_elems, pos ))