| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 128 MB | 257 | 170 | 145 | 65.611% |
Han Solo wants a count of all the enemy fighters he shot down while captain of the Millennium Falcon. The data log has a list of kills but not the totals. You job is to write a program that will read the data log and display the name of the fighter followed by the number shot down and the total number of kills.
Each line of input will contain the name of the fighter that was shot down. The end of input is marked with a 0 on the last line.
The name of the fighter followed immediately by a colon followed by the number shot down. There should be one blank between the colon and the number shot down. The last line of output will be the word “Grand Total” followed immediately by a colon and the grand total of all fighters shot down. There should be one blank between the colon and the grand total. The fighters should be listed in order of first occurrence.
Tie-fighter V-wing Starfighter Starfighter Tie-fighter Tri-fighter V-wing Starfighter Tie-fighter V-wing Tri-fighter V-wing Starfighter Tie-fighter 0
Tie-fighter: 4 V-wing: 4 Starfighter: 4 Tri-fighter: 2 Grand Total: 14