#include<iostream>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
/*
struct T1{
  int v;
  bool ope1(const T1&a){
    return(v<a.v);
  }
};
struct T2{
   int v;
};
struct cmp{
  const bool op(const T2 &a,const T2 &b )
     { return (a.v<b.v);}
};*/

void mian(){

    //map<T1,int>mt1;
    //map<T2,int ,cmp>mt2;

    map<int,int>m2;
    m2[0]=1;
        m2.insert(make_pair(3,9));
    cout<<m2[0]<<endl;
    //map<string,int>::iterator m2i,p1,p2;
    /*m2[0]=2;
    m2[1]=1;
    m2[2]=2;
    
    m2.insert(make_pair("3",9));
    m2[7]=4;
    m2[6]=2;
    cout<<m2[7]<<endl;

    m2i=m2.find("cba");
    if(m2i!=m2.end()){
       cout<<m2i->first<<":"<<m2i->second<<endl;
    }
    else{cout << "find nothing" << endl;}
   
    cout<<"iterate"<<endl;
    for(m2i=m2.begin();m2i!=m2.end();m2i++){
       cout << m2i->first << ": " << m2i->second << endl;
    }*/
    m2.clear();
   return;
}

posted on 2013-02-23 15:04  叶城宇  阅读(143)  评论(0编辑  收藏  举报