Answers for "how to do sets in cpp"

C++
1

how to do sets in cpp

#include <set>

int main() {
  set<int> my_set = {1, 2, 3, 4};
  for (int i = 0; i < 4; i++) {
    cout << my_set[i] << endl;
  }
}
Posted by: Guest on October-01-2021
-1

sets in c++

set<int>s; //Creates a set of integers.
Posted by: Guest on December-31-2020

Browse Popular Code Answers by Language