1133: 单词个数统计
来源:互联网 发布:webrtc 源码介绍 编辑:程序博客网 时间:2024/06/05 18:19
Description
从键盘输入一行字符,长度小于1000。统计其中单词的个数,各单词以空格分隔,且空格数可以是多个。
Input
输入只有一行句子。仅有空格和英文字母构成
Output
单词的个数
Sample Input
stable marriage problem Consists of Matching members
Sample Output
7
HINT
Source
#include <stdio.h>#include <stdlib.h>//统计单词个数,有多个空格int main(){ char str[1000]; int i=0,count=0; gets(str); if(str[0]!=' ') count=1; for(i=1; str[i]!='\0'; i++) { if(str[i-1]==' '&& str[i]!=' ') count++; } printf("%d\n",count); return 0;}
阅读全文
0 0
- 1133: 单词个数统计
- 1133: 单词个数统计
- 1133: 单词个数统计
- vc 统计单词个数
- 统计单词个数
- 统计单词个数
- 统计单词个数
- 统计单词个数
- 统计单词个数
- 统计单词个数
- 状态机统计单词个数
- wikioi1040 统计单词个数
- C统计单词个数
- 统计不同单词个数
- 统计单词个数
- acm-统计单词个数
- 17.2统计单词个数
- 统计单词个数
- spring mvc 给Controller添加事务
- Tomcat启动时加载数据到缓存--Web.xml里listener的加载顺序,优先初始化Spring IOC容器
- 关于android webview 的那些坑
- ArrayDeque
- 面向对象中的原型链
- 1133: 单词个数统计
- js 回调
- 基于OpenXES的XES反序列化源码示例
- 用NPOI操作EXCEL--画线
- nodejs安装
- 1016.部分A+B (15)
- 如何找到自己的公钥
- 消息推送,定时任务
- 格密码初步学习记录(三)SVP