// Map_Process.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include #include using std::cout; using std::endl; typedef std::map< int, double, std::less< int > >mid; int _tmain(int argc, _TCHAR* argv[]) { mid pairs; pairs.insert( mid::value_type( 15, 2.7 ) ); pairs.insert( mid::value_type( 30, 111.11 ) ); pairs.insert( mid::value_type( 5, 1010.1 ) ); pairs.insert( mid::value_type( 10, 22.22 ) ); pairs.insert( mid::value_type( 25, 33.333 ) ); pairs.insert( mid::value_type( 5, 77.54 ) ); pairs.insert( mid::value_type( 15, 99.3 ) ); cout<<"pairs contains:/nKey/tValue/n"; for( mid::const_iterator iter = pairs.begin(); iter != pairs.end(); ++iter ) { cout<< iter->first << '/t' << iter->second << '/n'; } pairs[25] = 9999.99; pairs[40] = 8765.43; cout<<"/nAfter subscript operations, pairs contains:" << "/nKey/tValue/n"; for( mid::const_iterator iter2 = pairs.begin(); iter2 != pairs.end(); ++iter2 ) { cout< first << '/t' < second <<'/n'; } cout<