You have to read the file in and store it in a container that can be sorted.
Then you need to sort the content of the container.
Then you print the content of the container.
The standard library has all the things you need.
Containers are here: http://en.cppreference.com/w/cpp/container
Find something suitable, we tend to use vector by default and choose something else when vector won't do.