개요
- C++ set
- C++ 집합, C++ 세트, C++ 셋
#include <iostream>
#include <set>
using namespace std;
int main() {
set<string> s = {"apple", "banana", "cherry"};
for(auto& el: s) {
cout << el << " ";
}
}
#include <iostream>
#include <set>
using namespace std;
int main() {
set<string> s;
s.insert("apple");
s.insert("banana");
s.insert("cherry");
s.insert("apple");
for(auto& el: s) {
cout << el << " ";
}
}