跳到正文

个人记录

set

hawkii约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年7月9日
篇幅
约 1 分钟
获赞
1

版本

  1. v1当前
C++
#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;
}
原文
抓取于
  1. qzgx_41

    呀呀,我身我又想到了并查集