본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 20001번 고무오리 디버깅

by 현장 2022. 3. 15.

-코드

start = input()
cnt = 0
while 1:
    s = input()
    if s == '문제':
        cnt += 1
    elif s == '고무오리':
        if cnt == 0:
            cnt += 2
        else:
            cnt -= 1
    else:
        break
print('고무오리야 사랑해' if cnt == 0 else '힝구')