代码少,就少撸点············
#if 1
#include <set>
using namespace std;
int main()
{
set<int> set_test;
set_test.insert(5);
set_test.insert(1);
set_test.insert(3);
set_test.insert(2);
set_test.insert(5);//键值重复 不会插入
int a[] = { 7, 8, 9 };
set_test.insert(a, a + 3);
set<int>::iterator it;
for (it = set_test.begin(); it != set_test.end(); ++it)
cout << *it << " ";
cout << endl;
cout << "----------" << endl;
set<int>::reverse_iterator rit;
for (rit = set_test.rbegin(); rit != set_test.rend(); ++rit)
cout << *rit << " ";
cout << endl;
set_test.erase(set_test.find(1));
set_test.erase(2);
return 0;
}
#endif //set 集合
主人,没撸够的话,那就网上再找找资源吧!反正小妲己没资源了···············