STL中的set容器

 1 #include <iostream>
 2 #include <set>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     set<int> s;
 9     s.insert(2);
10     s.insert(1);
11     s.insert(3);
12 
13     cout<<*s.begin()<<endl;
14 
15     return 0;
16 }

输出为1

posted @ 2016-03-21 16:20  hu983  阅读(165)  评论(0编辑  收藏  举报