7326: Dog Treats(Problem J1)
内存限制:128 MB
时间限制:1.000 S
评测方式:文本比较
命题人:
提交:22
解决:6
题目描述
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:
1 × S + 2 × M + 3 × L
where S is the number of small treats, M is the number of medium treats and L is the number of
large treats.
If Barley’s happiness score is 10 or greater then he is happy. Otherwise, he is sad. Determine whether Barley is happy or sad at the end of the day.
If Barley’s happiness score is 10 or greater then he is happy. Otherwise, he is sad. Determine whether Barley is happy or sad at the end of the day.
输入
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.
样例输入 复制
3
1
0
样例输出 复制
sad
提示
Barley’s happiness score is 1 × 3 + 2 × 1 + 3 × 0 = 5, so he will be sad.
Sample Input 2
3
2
1
Output for Sample Input 2
happy
Explanation of Output for Sample Input 2 Barley’s happiness score is 1 × 3 + 2 × 2 + 3 × 1 = 10, so he will be happy.
Sample Input 2
3
2
1
Output for Sample Input 2
happy
Explanation of Output for Sample Input 2 Barley’s happiness score is 1 × 3 + 2 × 2 + 3 × 1 = 10, so he will be happy.