#include <iostream>
#include <utility>
#include <string>
#include <vector>
using namespace std;
int main()
{
string str;
int iVal;
cout<<"\tinput some pair contents( pair< string, int >) (^Z to end):\n";
vector< pair< string, int > >pairVec;
while( cin>> str >>iVal )
pairVec.push_back( pair< string, int>( str, iVal ) );
cout<<"\n\tThe content of pairVec is:\n";
for( vector< pair< string, int > >::iterator it = pairVec.begin(); it != pairVec.end(); ++it )
cout<< it->first <<" " <<it->second <<endl;
system("pause");
return 0;
}
#include <utility>
#include <string>
#include <vector>
using namespace std;
int main()
{
string str;
int iVal;
cout<<"\tinput some pair contents( pair< string, int >) (^Z to end):\n";
vector< pair< string, int > >pairVec;
while( cin>> str >>iVal )
pairVec.push_back( pair< string, int>( str, iVal ) );
cout<<"\n\tThe content of pairVec is:\n";
for( vector< pair< string, int > >::iterator it = pairVec.begin(); it != pairVec.end(); ++it )
cout<< it->first <<" " <<it->second <<endl;
system("pause");
return 0;
}