Advertisement
Alex_Fomin

Untitled

Dec 17th, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <algorithm>
  2. #include <iterator>
  3. #include <iostream>
  4. #include <functional>
  5.  
  6. int main() {
  7.   int arr[] = { -1, 2, 4, 5, -4, -6, 3, -4 };
  8.   std::stable_partition(arr, arr + sizeof(arr) / sizeof(arr[0]), std::bind2nd(std::greater<int>(), 0));
  9.   std::copy(arr, arr + sizeof(arr) / sizeof(arr[0]), std::ostream_iterator<int>(std::cout, " "));
  10.   return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement