We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
from Volume 0. Getting Started
给一个字符串,计算其中有多少个单词。其中对单词的定义是,一段连续的由小写或大写字母组成的序列。
声明一个布尔值bo,记录前一个字符是否为字母。然后遍历这个字符串,如果当前字符为字母,且bo为false的话,说明这是单词中的第一个字母,记录下来即可。
bo
false