To solve this problem you have to complete the code that you will find at the end of the statement. You have to replace each ??? with one or more lines of code. Do not change anything else. Download from the website of the problem the file code.cc with the code to be completed (click on the corresponding button “.CPP”), edit it and submit it to the judge.
We want to keep basic information about the money donations to a hospital. In particular, we want to store the total money donated by each person, which is uniquely identified with his or her nif (8 digits followed by an uppercase control letter).
The program allows us to do five different operations:
Input
Input consists of several operations as indicated above. Nifs are correct, and donations are strictly positive integer numbers.
Output
For each operation (except donations), print the requested information. It is guaranteed that the maximum accumulated donation will not be greater than 109.
Input
N L P D 02345678T 1000 D 98765433Y 500 Q 02345678T Q 12345679S P L D 98765432M 500 D 98765433Y 2000 N P L D 99999999R 700 L
Output
number: 0 NO LAST NIF 1000 -1 02345678T 98765433Y 500 number: 3 02345678T 98765432M 98765433Y 2500 99999999R 700