STL

#pragma warning (disable:4786) 
#include <map>

#include <string>

#include <iostream>

using namespace std;

int main()

{
    
    map<int, string> mapStudent;
    
    mapStudent.insert(pair<int, string>(1, "student_one"));
    
    mapStudent.insert(pair<int, string>(2, "student_two"));
    
    mapStudent.insert(pair<int, string>(3, "student_three"));
    
    map<int, string>::iterator  iter;
    
    for(iter = mapStudent.begin(); iter != mapStudent.end(); iter++)
        
    {
        
        cout<<iter->first<<"   "<<iter->second<<endl;
        
    }
    return 0;
}
/*http://www.kuqin.com/cpluspluslib/20071231/3265.html*/

 

相关文章:

  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-06-04
  • 2021-05-17
猜你喜欢
  • 2021-07-04
  • 2021-05-22
  • 2021-11-06
相关资源
相似解决方案