当前位置:网站首页>6-1 how many words are needed to form a sentence?
6-1 how many words are needed to form a sentence?
2022-06-11 17:37:00 【Tomatoes_ Menon】
This question requests to realize a function , Count the number of words in a string .
Function interface definition :
int fun ( char *s );Sample referee test procedure :
Here is an example of a function being called for testing . for example :
#include <stdio.h>
int fun ( char *str );
int main()
{
char str[20];
gets(str);
printf("%d",fun(str));
return 0;
}
/* Please fill in the answer here */sample input :
how are you
sample output :
3int fun ( char *s )
{
int count=0;
int i=0;
while(s[i]){
if(s[i]==' ')
count++;
i++;
}
return count+1;
}
边栏推荐
- Classification and method of feature fusion
- Service学习笔记03- 前台服务实战
- 定制 or 订阅?未来中国 SaaS 行业发展趋势是什么?
- Chapter II relational database
- 6-8 有结构文件的读写1
- How to become an optimist organization?
- Vscode configures eslint to automatically format with an error "the setting is deprecated. use editor.codeactionsonsave instead with a source“
- Activity | authing's first channel cooperation activity came to a successful conclusion
- Xie Yang, CEO of authing, was selected into Forbes' 30 under 30 Asia list in 2021
- From manufacturing to "intelligent manufacturing", explore the way for manufacturing enterprises to break the situation
猜你喜欢

Vscode configures eslint to automatically format with an error "the setting is deprecated. use editor.codeactionsonsave instead with a source“

QLineEdit 设置输入掩码

Automated testing selenium

Port planning and APJ

你还不懂线程池的设计及原理吗?掰开揉碎了教你设计线程池

04_ Feature engineering feature selection

Qlineedit set input mask

括号生成---2022/02/25

Authing CEO 谢扬入选福布斯 2021 年 30 Under 30 亚洲榜单

为什么udp流设置1316字节
随机推荐
tidb-cdc创建任务报错 Unknown or incorrect time zone
6-1 read string (*) from file
端口规划与APJ
Speed adjustment of tidb DDL
tidb-数据误删恢复的几种方式
Set object mapping + scene 6-face mapping + create space in threejs
Bentley uses authing to quickly integrate application system and identity
What is the minimum change price of PTA futures? How can PTA futures be safe?
活动 | Authing 首次渠道合作活动圆满落幕
What subclasses inherit, polymorphism, and upward transformation
7-1 均是素数
04_ Feature engineering feature selection
Delete the penultimate node of the linked list ---2022/02/22
6-7 文件读写操作
Automated testing selenium
Dynamic: capturing network dynamics using dynamic graph representation learning
Mathematical foundations of information security Chapter 3 - finite fields (I)
Chorus translation
Authing biweekly news: online application market (5.10-5.22)
6-8 有结构文件的读写1