#include <bits/stdc++.h>
using namespace std;
集合
set<int>st;
set<int>::iterator it; 域操作符,it是存地址的变量
int main()
{
st.insert(1);
st.insert(5);
cout <<"集合大小"<< st.size() << endl;
st.insert(2);
st.insert(5);
cout <<"集合大小"<< st.size() << endl;
it = st.begin();
cout << *it << endl; *得到地址对应的值
return 0;
}
set
文章信息与版本
文章信息
- 收录
- 2025年12月12日
- 更新
- 2026年7月9日
- 篇幅
- 约 1 分钟
- 获赞
- 1