Happy or Sad
Time limit1sMemory limit256 MB
Count the happy (:-)) and sad (:-( ) emoticons in the message and print happy, sad, unsure, or none.
- Level
Easy1 of 10
- Topics
- String
- Solved
- No attempts yet
Problem
Seungyeop often puts emoticons in his text messages to show how he feels. Each emoticon he uses is three characters stuck together: :-) for a happy face and :-( for a sad face.
Hyeseong thinks the emoticons are a fake-cute habit and dislikes them, so she wants a program that reads a message from Seungyeop and reports only its overall mood.
Input
The first line holds between 1 and 255 characters. The line can contain spaces.
Output
Print one line according to these rules.
- If the line has no emoticon at all, print none.
- If the number of happy emoticons equals the number of sad emoticons, print unsure.
- If there are more happy emoticons than sad ones, print happy.
- If there are more sad emoticons than happy ones, print sad.