##include <string>
#include <set>
#include <vector>
using namespace std;
1、string
begin( )
end( )
eg:
string str;
for ( string::iterator p = str.begin( ); p != str.end( ); ++p ) //开始与结束
{
if ( *p == '-' )
{
continue;
}
.............
}
str.insert( 3 , "-" );//插入
2、set
multiset< string > nums;//多元集合定义
set< string > names;//集合定义
nums.insert( newstr ); //插入元素
names.insert( newstr );
for ( set< string >::iterator p = names.begin( ); p != names.end( ); ++p ) { //集合游标的使用
int c = nums.count( *p ); //多元集合的计数
if ( c > 1 )
{
............
}
}
3、vector
vector< int > vect;
vect.push_back(2);