1.插入配对
std::vector<pair<int,int> > w;
w.push_back(make_pair<int,int>(f,s) );
cout <<w[i].first << " " << w[i].second <<endl;
2.元素去重
std::vector<int> all;
sort(all.begin(), all.end());
std::vector<int>::iterator nown = unique(all.begin(), all.end());
all.erase(nown,all.end());
3.排序
sort(all.begin(), all.end());
时间: 2024-10-01 14:00:02