字符串中单词的个数
来源:互联网 发布:日本男装品牌 知乎 编辑:程序博客网 时间:2024/06/06 14:28
#include<iostream>using namespace std;int main(){ char cstring[100]; int index, iword = 1; char blank; gets(cstring); if (cstring[0] == '\0') { cout << "there is no char" << endl; } else if (cstring[0] == ' ') cout << "the first char is a blank" << endl; else { for (index = 0; cstring[index] != '\0'; index++) { blank = cstring[index]; if (blank == ' ') { iword++; } } cout << "the words number is " << iword << endl; } system("pause"); return 0;}
0 0
- 字符串中单词的个数
- 求字符串中单词的个数
- 统计字符串中单词的个数
- 输出一个字符串中单词的个数
- 统计字符串中单词的个数
- 计算一段字符串中单词的个数
- 统计字符串中单词的个数
- 字符串中不重复的单词个数
- 字符串中单词的个数以及最大长度单词求解
- 统计字符串中单词个数
- 计算字符串中单词个数
- 【字符串操作】01.统计一个字符串中单词的个数
- 字符串部分-单词拼接-单词的个数
- 字符串中单词的个数(状态机的使用)
- 字符串中单词的个数(状态机的使用)
- 字符串中单词的个数(状态机的使用)
- 统计字符串中单词的个数(指针)
- 求给定字符串中包含单词的个数
- IO流详解
- UVALive 6525 二分匹配
- GUI
- HTTP Live Streaming协议草案各版本加入的新特性
- Java核心技术第3章(2)
- 字符串中单词的个数
- quick-find【连通图】
- 4.2二叉排序树
- 把数组排成最小的数(剑指offer)string+vector
- 《深入理解Linux网络技术内幕》阅读笔记(三)
- 深入理解Java的接口和抽象类
- 如何处理信息是目前的首要矛盾——判断力
- HDU 1075 What Are You Talking About(用map进行翻译)
- 【android】聊天界面的制作-简易版实现