stblptn0.cpp

stblptn0.cpp

#include ‹stl.h›

#include ‹iostream.h›

bool less_10(int a_) {

 return a_ ‹ 10 ? 1 : 0;

}

int numbers[6] = {10, 5, 11, 20, 6, -2};

int main() {

 stable_partition(numbers, numbers + 6, less_10);

 for (int i = 0; i ‹ 6; i++) cout ‹‹ numbers[i] ‹‹ ;

 cout ‹‹ endl;

 return 0;

}