/*********************************************************************
程序名: 实例:96 计算字符串中子串出现的次数 。
说明:1. 转string 用find() 函数
2. 双循环
*********************************************************************/
#include <iostream>
using namespace std;
void FindCharByString()
{
char s[100];
char sub[100];
cout << "请输入两个字符串,以回车隔开,母串在前,子串在后:" << endl;
cin.getline(s, sizeof(s));
cin.getline(sub,
牛刀小试 - 计算字符串中子串出现的次数
最新推荐文章于 2024-06-20 09:09:43 发布