Lessons
C++ · Searching and Sorting · 34. Sorting

step 1 of 7

One line sorts

You don't have to sort by hand. sort lives in <algorithm> and puts a list in order, smallest first.

Mission

Add sort(v.begin(), v.end()); before the printing, then RUN.

PIP·1
main.cppyour code
1
2
3
4
5
6
7
8
9
10
11
12
13
← press me!
readyscreen

Press RUN to see what this program does.

Do the mission and Next turns green.

Sorting