방명록
- [백준] 19602번: Dog Treats - 파이썬2024년 11월 20일 22시 07분 22초에 업로드 된 글입니다.작성자: B1NK728x90
- 백준 링크: 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'백준' 카테고리의 다른 글
[백준] 12836번: 가계부 (Easy) - 파이썬 (0) 2024.11.22 [백준] 30821번: 별자리가 될 수 있다면 - 파이썬 (0) 2024.11.21 [백준] 7569번: 토마토 - 파이썬 (0) 2024.11.19 [백준] 5430번: AC - 파이썬 (0) 2024.11.18 [백준] 1700번: 멀티탭 스케줄링 - 파이썬 (2) 2024.11.17 다음글이 없습니다.이전글이 없습니다.댓글