Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iterator>
- #include <algorithm>
- #include <vector>
- #include <set>
- #include <map>
- using namespace std;
- template<typename It>
- void PrintRange(It range_begin, It range_end)
- {
- for (auto it = range_begin; it != range_end; ++it)
- {
- cout << *it << " ";
- }
- }
- int main()
- {
- vector <string> langs = { "Python", "C++", "C", "Java", "C#" };
- auto it = find_if(begin(langs), end(langs), [](const string& lang)
- {return lang[0] == 'C'; });
- cout << it - begin(langs) << endl;
- set<int> s = { 1,6,8,9 };
- auto it2 = s.find(6);
- //++it2;
- //PrintRange(it2, end(s));
- PrintRange(next(it2), end(s));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement