只有vector和deque的迭代器iterator可以使用>,>=,<,<=操作,因为set,map经过排序,位置做过移动,C++不允许他们位置前后做比较。
同样list迭代器iterator也不提供>,>=,<,<=操作,也不提供加减操作,但提供自增自减操作和=,!=操作。
所以为了防止出错for循环中统一使用!=符号。
#include <iostream>
#include <vector>
#include <set> //包含multiset
#include <functional> // 包含less和greater
using namespace std;
typedef multiset<int,greater<