2914字符串-空格数目统计

2914   字符串-空格数目统计

题目描述

输入一行字符,统计其中空格出现的次数,连续的空格作为一次空格出现计算。该行字符可能以空格开始,也可能以空格结束,空格也可能出现在这行字符的中间。

输入格式:

一串英文的字符串

输出格式:

字符串中空格数目(连续空格作为一个空格看待)
输入样例 复制
  As he came into the window It was the sound of a crescendo. He came into her apartement. He left the bloodstains on the carpet.
输出样例 复制
There are 25 spaces in the line.

说明

scanfgets中选择合适的接口
179
342
通过提交
时空限制1000ms/128mb
题目来源YW
评测方式在线评测
题目类型基础入门
难        度