你好,我有一個std ::設置包含下列元素對:刪除對重複設置:: C++
set<pair<string, int> > mapElem;
apples 1
apples 2
at 1
eating 1
eating 2
football 1
going 1
today 1
today 2
today 3
today 4
today 5
tommy 1
tommy 2
我需要找到一種方法來刪除重複項,只留與第二對最高的那些。 (對不起,如果這或標題混淆) 編輯:如果可能,不使用std :: map!
apples 2
at 1
eating 2
football 1
going 1
today 5
tommy 2
對不起,我編輯我的帖子,我不能使用地圖:( – Kobe 2011-03-09 23:47:57
添加了一個替代沒有地圖 – Erik 2011-03-09 23:52:09
哇...我沒有文字,它的工作。非常感謝你 – Kobe 2011-03-09 23:56:47