실험실
  • [백준] 19602번: Dog Treats - 파이썬
    2024년 11월 20일 22시 07분 22초에 업로드 된 글입니다.
    작성자: B1NK
    728x90
    • 백준 링크: 19602번: Dog Treats
    • solved.ac 난이도: 브론즈 IV
    • 시간 제한: 2 초
    • 메모리 제한: 512 MB

    문제

    Barley the dog loves treats. At the end of the day he is either happy or sad depending on the number and size of treats he receives throughout the day. The treats come in three sizes: small, medium, and large. His happiness score can be measured using the following formula:

    입력

    There are three lines of input. Each line contains a non-negative integer less than 10. The first line contains the number of small treats, S, the second line contains the number of medium treats, M, and the third line contains the number of large treats, L, that Barley receives in a day.

    출력

    If Barley’s happiness score is 10 or greater, output happy. Otherwise, output sad.

    코드

    S = int(input())
    M = int(input())
    L = int(input())
    print("happy" if S*1 + M*2 + L*3 >= 10 else "sad")
    728x90
    댓글