Inserting an Iterator Range into a Set

Правка en1, от Asliddin2010, 2024-12-16 13:16:21

// C++ program to Insert // Elements In set using // Iterator Range

include <bits/stdc++.h>

using namespace std;

int main() { vector v{ 10, 20, 30 }; // Create an empty set set s;

// Inserting values of vector to set
s.insert(v.begin(), v.end());

// Printing the set
for (int x : s) {
    cout << x << " ";
}

return 0;

} // Output: 10 20 30

Теги set, insert, interator range

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en10 Английский Asliddin2010 2024-12-16 13:31:04 0 (published)
en9 Английский Asliddin2010 2024-12-16 13:30:50 1019
en8 Английский Asliddin2010 2024-12-16 13:29:27 3711 For those who didn't know, if you know, just a revision :)
en7 Английский Asliddin2010 2024-12-16 13:26:24 2498
en6 Английский Asliddin2010 2024-12-16 13:25:41 461
en5 Английский Asliddin2010 2024-12-16 13:24:48 1942
en4 Английский Asliddin2010 2024-12-16 13:23:19 4 Tiny change: 'or Range\ninclude ' -> 'or Range\n\n\ninclude '
en3 Английский Asliddin2010 2024-12-16 13:22:03 17
en2 Английский Asliddin2010 2024-12-16 13:18:58 41 For those who didn't know, if you know, just a revision :)
en1 Английский Asliddin2010 2024-12-16 13:16:21 463 For those who didn't know, if you know, just a revision :) (saved to drafts)