P0013. Words between dashes P15714


Statement
 

pdf   zip

thehtml

Consider a sequence of words formed by letters. The words are separated with dashes, which can appear also at the beginning and in the end of the sequence. The sequence ends with a dot.

Your task is to write a program that prints the number of short words (less than five letters), medium (between five and nine letters), and long (more than nine letters).

Input

The input consists of a line with letters and dashes, finished with a dot.

Output

Your program must print a line with the number of short, medium and long words separated by commas.

Observation

Using |strings| is not allowed in this problem.

Public test cases
  • Input

    .
    

    Output

    0,0,0
    
  • Input

    -----abcde-.
    

    Output

    0,1,0
    
  • Input

    aaabbbccc.
    

    Output

    0,1,0
    
  • Input

    ----------------.
    

    Output

    0,0,0
    
  • Input

    easy--to-solve-problem----.
    

    Output

    2,2,0
    
  • Input

    -be-careful---repeated-dashes-and-final-word.
    

    Output

    3,4,0
    
  • Information
    Author
    Professorat de P1
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++ Python