#include <stdio.h>
//a查找范围 b查找目标
int fun(char *a,char *b) {
int n=0;
while(*a)
{
if(*a==*b) n++;
a++;
}
return n;
}
int main()
{
char zf[]="我喜欢我我我我C语言",zf1[]="我";
printf("%d",fun(zf,zf1));
getchar();
}
标签:int,zf,++,C语言,char,fun,查找,字符串
来源: https://www.cnblogs.com/xkdn/p/15303233.html