当前位置:网站首页>Count the number of words C language
Count the number of words C language
2022-07-07 08:57:00 【Please Sit Down】
subject : Enter a line of characters , Statistics of which English words The number of . Space between words .
#define N 50
int main(void){
char str[N];
printf(" Please enter :");
gets(str);
char *p;
p = str;
int sum=0;
while(*p){
if(*p>='a'&&*p<='z' || *p>='A'&&*p<='Z'){
sum++;
}
p++;
}
printf(" Altogether %d Word !",sum);
return 0;
}subject : Enter a line of characters , Statistics of which word The number of . Space between words .
#define N 50
int main(void){
char str[N];
printf(" Please enter :");
gets(str);
char *p;
p = str;
int sum=0,flag=0;
while(*p){
if(*p == ' '){
flag = 0;
}else if(flag == 0){
sum++;
flag = 1;
}
p++;
}
printf(" Altogether %d Word !",sum);
return 0;
}边栏推荐
- The longest ascending subsequence model acwing 1017 Strange thief Kidd's glider
- Quick sorting (detailed illustration of single way, double way, three way)
- 面试题:高速PCB一般布局、布线原则
- JS operation
- 使用Typora编辑markdown上传CSDN时图片大小调整麻烦问题
- 数字三角形模型 AcWing 1027. 方格取数
- With an annual salary of 50W, Alibaba P8 will come out in person to teach you how to advance from testing
- go mod module declares its path as: gtihub. com/xxx-xx but was required as:xx-xx
- QT charts use (rewrite qchartview to realize some custom functions)
- OpenGL frame buffer
猜你喜欢

硬核分享:硬件工程师常用工具包

阿里p8推荐,测试覆盖率工具—Jacoco,实用性极佳

Greenplum6.x常用语句

Unityshader introduction essentials personal summary -- Basic chapter (I)

面试题:高速PCB一般布局、布线原则

Recommended by Alibaba P8, the test coverage tool - Jacobo is very practical
![[Yugong series] February 2022 U3D full stack class 005 unity engine view](/img/19/dc1b2f74b9ec5f5808de3049793862.jpg)
[Yugong series] February 2022 U3D full stack class 005 unity engine view

let const

oracle一次性说清楚,多种分隔符的一个字段拆分多行,再多行多列多种分隔符拆多行,最终处理超亿亿。。亿级别数据量

Pointer advanced, string function
随机推荐
数字三角形模型 AcWing 1027. 方格取数
【ChaosBlade:节点磁盘填充、杀节点上指定进程、挂起节点上指定进程】
面试题:高速PCB一般布局、布线原则
如何统计项目代码行数
Several methods of calculating the average value of two numbers
Opencv converts 16 bit image data to 8 bits and 8 to 16
Output all composite numbers between 6 and 1000
let const
go mod module declares its path as: gtihub. com/xxx-xx but was required as:xx-xx
Unityshader introduction essentials personal summary -- Basic chapter (I)
[Yugong series] February 2022 U3D full stack class 007 - production and setting skybox resources
Simulation volume leetcode [general] 1557 The minimum number of points that can reach all points
Three series of BOM elements
Greenplum 6.x reinitialization
Why choose cloud native database
Personal deduction topic classification record
Greenplum6.x搭建_安装
Frequently Asked Coding Problems
STM32串口寄存器库函数配置方法
Database storage - table partition