Example: Result:
[9,1] [0,5]
[5,2] [2,4]
[6,3] [5,2]
[2,4] [6,3]
[0,5] [9,1]
I know that the meaning lies in the comparison function. How to sort in ascending or descending order.
Thanks.
use std::sort
from the <algorithm>
header
you can use a lambda expression as comparison function