[백준] Dog Treats (19602)(kotlin)

문제 설명

백준 19602번 문제 링크

입력 및 출력

» 입력

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
3
2
1
happy

문제 풀이1

import java.util.Scanner

val sc = Scanner(System.`in`)

fun main(args: Array<String>) = println(
    if((1 * sc.nextInt()) + (2 * sc.nextInt()) + (3 * sc.nextInt()) >= 10) "happy"
    else "sad"
)