inplmrg1.cpp

We use cookies. Read the Privacy and Cookie Policy

inplmrg1.cpp

#include ‹stl.h›

#include ‹iostream.h›

int numbers[6] = {1, 10, 42, 3, 16, 32};

int main() {

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

 cout ‹‹ endl;

 inplace_merge(numbers, numbers + 3, numbers + 6);

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

 cout ‹‹ endl;

 return 0;

}