BOJ/백준-10886-python

cosmos·2022년 3월 27일
0
post-thumbnail

문제

풀이

  • if else 조건문에 따라 증감식을하면 쉽게 구현할 수 있다.

코드

# https://www.acmicpc.net/problem/10886
# boj, 10886: 0 = not cute / 1 = cute, python3
import sys

input = sys.stdin.readline

def solve(n: int) -> str:
    own, zero = 0, 0

    for _ in range(n):
        number = int(input())

        if number == 1:
            own += 1
        else:
            zero += 1

    return 'Junhee is cute!' if own > zero else 'Junhee is not cute!'

if __name__ == '__main__':
    n = int(input())

    print(solve(n))

결과

출처 & 깃허브

BOJ 10886
GITHUB

0개의 댓글