PAT C++标准库使用 Posted on 2018-09-06 | Edited on 2018-09-07 | In OJ , PAT | iterator1234prev(v.end())next(it)rbegin(v)... algorithmsort从大到小排序:1sort(a.begin(), a.end(), greater<int>()); vector删除特定元素1v.erase(remove_if(v.begin(), v.end(), pred), v.end()); string删除特定字符1s.erase(remove_if(s.begin(), s.end(), pred), s.end()); find12size_type pos = s.find(ch);pos == string::npos ? queuepriority_queue123456struct X;priority_queue<X, vector<X>, decltype(cmp)> pq(cmp);priority_queue<X, vector<X>, greater<X>> pq;pq.push();pq.top();pq.pop(); set合并set1s1.insert(s2.begin(), s2.end()); numericaccumulate123vector<string> vs;string a;string res = accumulate(vs.begin(), vs.end(), a);