DSP

STL练习程序(map...)

2019-07-13 15:22发布

#pragma warning (disable:4786) #include <string> #include #include using namespace std; int main() { string name[]={"tian","dsp","su","chu"}; map<int,string> mapname; for (int i=0;i<4;i++) { mapname.insert(pair<int,string>(i,name[i])); } map<int,string>::iterator mapit; for (mapit=mapname.begin();mapit!=mapname.end();mapit++) { cout<first<<" "<second<<endl; } system("pause"); return 0; }