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

[백준/파이썬] 4447번 좋은놈 나쁜놈

by 현장 2022. 8. 3.

-Code

for _ in range(int(input())):
    s = input()
    g_cnt = s.count('g') + s.count('G')
    b_cnt = s.count('b') + s.count('B')
    if g_cnt > b_cnt:
        print(s + " is GOOD")
    elif g_cnt < b_cnt:
        print(s + " is A BADDY")
    else:
        print(s + " is NEUTRAL")