This program illustrates the use of the STL partial_sort_copy() algorithm (extended version) to order a range of values from a vector of integers of size 12 into the order determined by increasing digit sum, and copy as many of them as will fit into a range within a second vector of integers. The contents of the initial vector are unchanged by this action. Press Enter to continue ... Here are the initial contents of vector v1: 92 21 53 84 46 13 41 76 45 61 11 15 Press Enter to continue ... Here are the initial contents of vector v2: 100 200 300 400 500 Press Enter to continue ... Now we make the following call: p = partial_sort_copy(v1.begin(), v1.end(), v2.begin(), v2.begin()+3, hasSmallerDigitSum); Press Enter to continue ... After that call, here are the contents of v1: 92 21 53 84 46 13 41 76 45 61 11 15 Press Enter to continue ... And here are the contents of v2: 11 21 13 400 500 Press Enter to continue ... The iterator p returned by the algorithm points to the value 400. Press Enter to continue ... Next we make the following call: p = partial_sort_copy(v1.begin()+2, v1.end()-2, v2.begin(), v2.end(), hasSmallerDigitSum); Press Enter to continue ... After that call, here are the contents of v1: 92 21 53 84 46 13 41 76 45 61 11 15 Press Enter to continue ... And here are the contents of v2: 13 41 61 53 45 Press Enter to continue ... The iterator p returned by the algorithm points to the end of the ouput container. Press Enter to continue ...