ptition0.cpp

We use cookies. Read the Privacy and Cookie Policy

ptition0.cpp

#include ‹stl.h›

#include ‹iostream.h›

int less_10(int a_) {

 return a_ ‹ 10 ? 1 : 0;

}

int numbers[6] = {6, 12, 3, 10, 1, 20};

int main() {

 partition(numbers, numbers + 6, less_10);

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

 cout ‹‹ endl;

 return 0;

}