统计字符串的个数
来源:互联网 发布:java字符串拼接工具类 编辑:程序博客网 时间:2024/06/06 11:45
#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <stdlib.h>#include <string.h> int statisticString(char *str,const char *findStr){if (NULL == str){return -1;}int num = 0;char *p = str;while (1){p = strstr(p, findStr);if (p == NULL){return num;}p += strlen(findStr);num++;}return num;} void test() { char *p = "asdsffgacd.,g.f,.fg, abcwwacdw"; char *findStr = "wac"; int num = statisticString(p, findStr); printf("%d ",num); }void main(){test();system("pause");}
0 0
- 统计字符串的个数
- 统计输入字符串的个数
- 统计重复字符串的个数
- 字符串中,插入字符串统计的个数
- 字符串的统计の数字的个数
- 统计字符串中每个英文字母的个数
- 统计字符串中各个字符的个数
- 统计字符串中相同字符的个数
- 统计字符串中字符的个数
- 统计字符串出现数字的个数
- 统计一个子字符串的个数 Java
- Ruby代码:如何统计字符串的个数?
- 统计字符串中大写字母的个数
- 统计字符串中大小写字母的个数
- 统计字符串中单词的个数
- 统计字符串中各个字符的个数
- 统计字符串中某个字符的个数
- 统计字符串中汉字的个数
- Mybatis的CRUD操作(基于xml)
- Linux下安装gurobi
- 第四周程序填空题2
- Linux makefile 教程 非常详细,且易懂
- linux tar gzip bzip2 compress
- 统计字符串的个数
- 数据库隔离级别
- Android actionBar 修改背景色
- so文件的简单分析
- 杭电1003的解决方法
- [leetcode]3. Longest Substring Without Repeating Characters
- Codeforces 724C Ray Tracing 扩展欧几里得
- 一道Java面试题之实现复制、删除、剪切文件(文件夹的实现)的snippet
- 【63.63%】【codeforces 724A】Checking the Calendar