fork(2) download
  1. #include <algorithm>
  2. #include <functional>
  3. #include <iostream>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. vector<int> v = { 1, 8, 7, 4, 3, 6, 2, 5 };
  10.  
  11. partition(begin(v), end(v), bind(greater<int>(), placeholders::_1, 7));
  12.  
  13. for(const auto& i : v) cout << i << ' ';
  14. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
8 1 7 4 3 6 2 5