Advertisement
kutuzzzov

Спринт 4. Урок 3.1 Концепция полуинтервалов

Dec 21st, 2021
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <string>
  4. #include <vector>
  5. #include <set>
  6.  
  7. using namespace std;
  8.  
  9. template <typename It>
  10. void PrintRange(It range_begin, It range_end) {
  11.     for (auto it = range_begin; it != range_end; ++it) {
  12.         cout << *it << " "s;
  13.     }
  14.     cout << endl;
  15. }
  16.  
  17. int main() {
  18.     set<int> test = { 1, 1, 1, 2, 3, 4, 5, 5 };
  19.     PrintRange(test.begin(), test.end());
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement