Skip to content

Files

Latest commit

author
uniqueNullptr2
Aug 10, 2021
e2dfcea · Aug 10, 2021

History

History

happy_or_sad

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 10, 2021
Aug 10, 2021
Aug 10, 2021
Aug 10, 2021
Aug 10, 2021

CCC '15 J2 - Happy or Sad

Canadian Computing Competition: 2015 Stage 1, Junior #2

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 Specification

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

Output Specification

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.