1133: 单词个数统计
来源:互联网 发布:蔡和森 知乎 编辑:程序博客网 时间:2024/06/06 19:58
1133: 单词个数统计
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 3786 Solved: 2136
SubmitStatusWeb Board
Description
从键盘输入一行字符,长度小于1000。统计其中单词的个数,各单词以空格分隔,且空格数可以是多个。
Input
输入只有一行句子。仅有空格和英文字母构成
Output
单词的个数
Sample Input
stable marriage problem Consists of Matching members
Sample Output
7
HINT
Source
#include<stdio.h>#include<string.h>#include<ctype.h>int main(){ char a[10000]; int n,i,s=0; gets(a); for(i=0; a[i]!='\0'; i++) { if(a[i]==' '&&a[i+1]!=' ') s++; } if(a[0]!=' ') s++; if(a[i-1]==' ') s--; printf("%d",s); return 0;}
阅读全文
0 0
- 1133: 单词个数统计
- 1133: 单词个数统计
- 1133: 单词个数统计
- vc 统计单词个数
- 统计单词个数
- 统计单词个数
- 统计单词个数
- 统计单词个数
- 统计单词个数
- 统计单词个数
- 状态机统计单词个数
- wikioi1040 统计单词个数
- C统计单词个数
- 统计不同单词个数
- 统计单词个数
- acm-统计单词个数
- 17.2统计单词个数
- 统计单词个数
- Tomcat中出现Server Tomcat v9.0 Server at localhost failed to start.解决办法
- C语言知识__宏
- 文件上传allowedTypes和文件下载contentType(mimeType)
- 如何解决 error adding symbols: Bad value 问题
- angularJs按钮变化
- 1133: 单词个数统计
- R语言数据导出
- Shell 数组
- [bzoj1941][kd-tree]Hide and Seek
- BZOJ2761: [JLOI2011]不重复数字
- linux内核网络分层结构
- angularJs复选框的选择状态筛选
- ubuntu/Linux 下 Pycharm 安装中文汉化包
- 三菱fx3u 高速计数器接口 最多接两路编码器