Problem list
Log in
#r03695 · CCC 2015 Junior

Happy or Sad

Bronze I 2.0 s 256 MB

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.

Input

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

Output

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.

Example 1

Input
How are you :-) doing :-( today :-)?
Output
happy

Example 2

Input
:)
Output
none

Example 3

Input
This:-(is str:-(:-(ange te:-)xt.
Output
sad
Source
CCC 2015 Junior
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code