简体   繁体   English

使用C ++中的集合

[英]Work with sets in C++

如何在C ++中定义集合并将值插入其中?

Use the std::set class in <set> . <set>使用std::set

std::set<int> s; // define a set of ints
s.insert(1);     // insert into a set

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM