Answers for "elements of set c++"

C++
0

elements of set c++

//Method 1:
 set<int>:: iterator it;
 for( it = s.begin(); it != s.end(); ++it){
    int ans = *it;
    cout << ans << endl;
 }
//Method 2:
 for( auto& it : s) {
     cout << it << " ";
 }
Posted by: Guest on May-31-2021

Code answers related to "elements of set c++"

Browse Popular Code Answers by Language