yelong的博客


  • Home

  • Tags

  • Categories

  • Archives

  • Search

C++ set

Posted on 2022-11-14 | In 算法 | | 阅读数

C++ set

https://cplusplus.com/reference/set/set/find/

判断元素在不在set中

可以用count()函数,如果为0,则不在set中;大于0,在set中;

1
2
3
4
set<int> ss;
ss.insert(1);
ss.insert(2);
cout<<ss.count(1)<<' '<<ss.count(3);
# 算法
C++ vector
端到端合成论文——声学模型——Tacotron
  • Table of Contents
  • Overview

203 posts
21 categories
25 tags
  1. 1. C++ set
    1. 1.1. 判断元素在不在set中
© 2025 Long Ye
Powered by Hexo
|
Theme — NexT.Muse v5.1.4
访客数 人 总访问量 次