STL map 按值排序
摘要:
//在STL中,map是按键来排序的,但很多时候需要按值来排序。一种方法是将map转化为vector,然后排序。#include<iostream>#include<vector>#include<map>#include<string>#include<algorithm>usingnamespacestd;voidsortMapByValue(map<string,int>&tMap,vector<pair<string,int>>&tVector);intcmp(constpa 阅读全文
posted @ 2011-07-31 09:28 原来... 阅读(4636) 评论(0) 推荐(0) 编辑