Logo
(追記) (追記ここまで)

5366번 - Total Count 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB25717014565.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.

제한

예제 입력 1

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

예제 출력 1

Tie-fighter: 4
V-wing: 4
Starfighter: 4
Tri-fighter: 2
Grand Total: 14

힌트

출처

School > PLU High School Programming Contest > PLU 2011 > Novice 8번

School > PLU High School Programming Contest > PLU 2016 > Novice 10번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /