Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <iterator>
- #include <iostream>
- #include <functional>
- int main() {
- int arr[] = { -1, 2, 4, 5, -4, -6, 3, -4 };
- std::stable_partition(arr, arr + sizeof(arr) / sizeof(arr[0]), std::bind2nd(std::greater<int>(), 0));
- std::copy(arr, arr + sizeof(arr) / sizeof(arr[0]), std::ostream_iterator<int>(std::cout, " "));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement