반응형
문제
26489번: Gum Gum for Jay Jay (acmicpc.net)
26489번: Gum Gum for Jay Jay
You are lost in the museum and keep walking by a giant rock head that says “gum gum for jay jay” each time you walk by. Print out the number of times you have walked by the giant rock head after reading in the data file.
www.acmicpc.net
풀이
C++로 EOFError를 처리하는 방법을 몰라서 익숙한 파이썬으로 코드를 작성하였습니다.
count = 0
while (1) :
try :
text = input()
count += 1
except EOFError :
break;
print(count)
반응형
'📊 알고리즘' 카테고리의 다른 글
[백준] 5341 - Pyramids (0) | 2022.12.27 |
---|---|
[백준] 14337 - Helicopter (0) | 2022.12.26 |
[백준] 6840 - Who is in the middle? (0) | 2022.12.24 |
[백준] 10189 - Hook (0) | 2022.12.23 |
[백준] 2547 - 사탕 선생 고창영 (0) | 2022.12.23 |