fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7. int c[] = { 2, 2, 3, 5, 7, 11, 11 };
  8. vector<int> v(c, c + sizeof(c)/sizeof(c[0]));
  9. auto i = equal_range(v.begin(), v.end(), 11);
  10. cout << "i.first=" << distance(v.begin(), i.first) << endl;
  11. cout << "i.second=" << distance(v.begin(), i.second) << endl;
  12. cout << "v.end()=" << distance(v.begin(), v.end()) << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
i.first=5
i.second=7
v.end()=7