#include <iostream>
#include <vector>
#include <list>
#include <deque>
#include <map>
#include <set>
using namespace std;
int main()
{
set<int> s;
s.insert(10);
s.insert(30);
s.insert(20);
s.insert(40);
s.insert(70);
s.insert(60);
s.insert(50);
s.insert(80);
s.insert(90);
s.erase(40);
set<int>::iterator findIt= s.find(50);
if (findIt == s.end()) {
cout << "못 찾음" << endl;
}
else {
cout << "찾음" << endl;
}
for (set<int>::iterator it = s.begin();it != s.end();++it) {
cout << (*it) << endl;
}
cout << "==============================================" << endl;
multimap<int, int> mm;
mm.insert(make_pair(1, 100));
mm.insert(make_pair(1, 200));
mm.insert(make_pair(1, 300));
mm.insert(make_pair(2, 400));
mm.insert(make_pair(2, 500));
pair<multimap<int, int>::iterator, multimap<int, int>::iterator> itPair;
itPair = mm.equal_range(1);
mm.lower_bound(1);
mm.upper_bound(1);
for (multimap<int, int>::iterator it = itPair.first;it != itPair.second;++it) {
cout << (*it).first << " " << (*it).second << endl;
}
for (multimap<int, int>::iterator it = mm.lower_bound(1);it != mm.upper_bound(1);++it) {
cout << (*it).first << " " << (*it).second << endl;
}
cout << "==============================================" << endl;
multiset<int> ms;
ms.insert(100);
ms.insert(100);
ms.insert(100);
ms.insert(200);
ms.insert(200);
multiset<int>::iterator findId = ms.find(100);
pair<multiset<int>::iterator,multiset<int>::iterator> itPair2= ms.equal_range(100);
ms.lower_bound(100);
ms.upper_bound(100);
for (multiset<int, int>::iterator it = itPair2.first;it != itPair2.second;++it) {
cout << (*it)<< endl;
}
for (multiset<int, int>::iterator it = ms.lower_bound(100);it != ms.upper_bound(100);++it) {
cout << (*it)<< endl;
}
}