Imena
의견: 0
1 \(s / 32\) \(MB / 50\) points
Little Mirko likes to type and often gets bored during class, which is why his teacher
assigned him a task.
Mirko must retype a book that contains \(N\)
spa\(ce-se\)parated sentences. In this book, a
sentence is an array of one or more spa\(ce-se\)parated words, where only the last word’s
character is a punctuation mark ( '.', '?' or '!' ). The rest of the words do not contain
punctuation marks.
Words are arrays of characters , either lowercase or uppercase letters of the English
alphabet, or digits or, exceptionally, a punctuation mark at the end of the last word in the
sentence.
Although he likes typing sentences, Mirko doesn’t like typing names. A name is a word that
starts with an uppercase letter of the English alphabet, whereas the rest of the characters
are lowercase letters of the English alphabet, except the last character, which can be the
punctuation mark. Before he decides to retype the whole thing, Mirko wants to know how
many names there are in each sentence of the book . Write a programme to help him!
In test cases worth 40 points total, it will hold \(N = 1\).
The first line of input contains the integer \(N\)
(1 ≤ \(N\)
≤ 5), the number from the task.
The second line contains \(N\)
sentences from the book. The total number of characters in the
book will not exceed 1000.
You must output \(N\)
lines. The \(i\)
\(th\)
line contains the number of names in the \(i\)
\(th\)
sentence.
1
Spavas li Mirno del Potro Juan martine?
4
2
An4 voli Milovana. Ana nabra par Banana.
1
2
평가 및 의견
Imena
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Imena