cswork / OA打开练习工作台

KoddiOA #1

Count Words Starting and Ending with Same Letter

估计简单可在线判题

考点(AI 标注)字符串

The text consists of English-letter words and spaces. Count the words whose first letter is the same as their last letter, ignoring case. For empty text, output 0.

The statement, the case rule, and the empty-string example are explicit; this site adds the line-based input protocol.

输入格式

A single line of text (possibly empty; at most 100000 characters), with words separated by one or more spaces.

输出格式

Output the number of qualifying words.

样例 1

输入:

Level Wow not now

输出:

2

样例 2

输入:

输出:

0

样例 3

输入:

A ab bB

输出:

2