1505: 蓝桥杯算法提高VIP-单词个数统计 摘要:```cpp #include #include using namespace std; int main() { char a[80]; gets(a); …… 题解列表 2023年01月30日 0 点赞 0 评论 175 浏览 评分:9.9
LikeWater - 1505: 蓝桥杯算法提高VIP-单词个数统计 摘要:```cpp #include using namespace std; // 题目描述 // 编写一个程序,输入一个字符串(长度不超过80), // 然后统计出该字符串当中包含有多少个单词…… 题解列表 2023年02月27日 0 点赞 1 评论 118 浏览 评分:9.9
1505: 蓝桥杯算法提高VIP-单词个数统计——Ccp 摘要:解题思路:注意事项:参考代码:#include<string.h>int main(){ char str[80]; int i; gets(str); int counts=0; for(i=0;i…… 题解列表 2023年03月09日 0 点赞 0 评论 152 浏览 评分:9.9
统 计 空 格 数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ string s; getline(cin,s); int …… 题解列表 2023年04月07日 0 点赞 0 评论 146 浏览 评分:9.9
1505:蓝桥杯算法提高VIP-单词个数统计-题解 摘要:解题思路:判断一个字符串中的单词个数,考虑如果该字符串中第i个字符不是字母,而第i+1个字符是字母,则单词个数+1,这样做也可规避多个空格连续或者有其他字符的情况。在判断字符是否不是字母时,表达困难,…… 题解列表 2023年05月06日 0 点赞 0 评论 167 浏览 评分:9.9
蓝桥杯算法提高VIP-单词个数统计(指针) 摘要:文章中的单词都是用空格间隔开的,换句话说,单词数=空格数+1。程序不认识单词,但是程序认识空格。这样,整个问题实际上转换成了统计文章中的空格数。可以使用指针写。也可以使用数组写第一种方法 使用指针//…… 题解列表 2023年11月22日 0 点赞 0 评论 269 浏览 评分:9.9
1505: 蓝桥杯算法提高VIP-单词个数统计 摘要:题目描述:编写一个程序,输入一个字符串(长度不超过80),然后统计出该字符串当中包含有多少个单词。 例如:字符串“this is a book”当中包含有4个单词…… 题解列表 2024年07月12日 0 点赞 0 评论 269 浏览 评分:9.9
3行解决,使用count计数函数 摘要:解题思路:用count函数读取空格数量,再存入变量b,在加1完成注意事项:参考代码:# 1505a = input()b = a.count(" ",0,len(a)) + 1print(b)…… 题解列表 2024年11月07日 0 点赞 0 评论 212 浏览 评分:9.9
单词个数统计(C++) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ …… 题解列表 2025年05月01日 1 点赞 0 评论 172 浏览 评分:10.0