Editorial for COCI '16 Contest 3 #1 Imena


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

In order to solve this task, we read the book word by word. Let cnt be a counter initially set to zero. While iterating over the words of the book, we increment the counter by 1 each time we come across a word that is also a name. Additionally, if we come across a word that has a punctuation mark as its last character, it means that the current sentence is ending, so we need to output the counter and reset it to zero.


Comments


  • 0
    Herve135  commented on Dec. 11, 2023, 6:18 a.m.

    maybe im just misunderstanding the problem but whats the way of calculating it