Happy or Sad | 프로그래밍의 벗 PivotOJ
PivotOJ

Happy or Sad

시간 제한: 1000ms메모리 제한: 256MB출처: CCC 2015 JuniorBOJ 10769

문제

We often include emoticons in our text messages to indicate how we are feeling. The three consecutive characters :-) indicate a happy face and the three consecutive characters :-( indicate a sad face. Write a program to determine the overall mood of a message.

입력

There will be one line of input that contains between 1 and 255 characters.

출력

The output is determined by the following rules:

  • If the input line does not contain any happy or sad emoticons, output none.
  • Otherwise, if the input line contains an equal number of happy and sad emoticons, output unsure.
  • Otherwise, if the input line contains more happy than sad emoticons, output happy.
  • Otherwise, if the input line contains more sad than happy emoticons, output sad.

예제

예제 1

입력
How are you :-) doing :-( today :-)?
출력
happy

예제 2

입력
:)
출력
none

예제 3

입력
This:-(is str:-(:-(ange te:-)xt.
출력
sad
코드를 제출하려면 로그인하세요.