PP2: Week 9,10: May 17 - 30
Worker and Salary 2
Each worker got his salary. This salary was changed during the year. Print surnames of the workers with their final salary at the end of the year in increasing order of surname.
Each line contains information about worker: surname and his salary. If the same worker appears once more again, it means that his salary was changed.
Print surnames and salaries of all workers at the end of the year in increasing order of surname.
Sidorov 100 Mamedov 150 Mamedov 250 Sidorov 110 Ivanov 200 Petrov 120 Sidorov 160 Ivanov 270
Ivanov 270 Mamedov 250 Petrov 120 Sidorov 160