#include<cstdio>
#include <stdio.h>
char *match(char *s,char ch);
int main(void){
char ch,str[80],*p=NULL;
printf("Please Input the string: \n");
scanf("%s",str);
getchar(str);
ch=getchar();
if((p=match(str,ch))!=NULL)
printf("%s\n",p);
else
printf("Not Found\n");
return 0;
}
char *match(char *s,char ch){
while(*s!='\0')
if(*s==ch)
return(s);
else
s++;
return(NULL);
}
字符定位问题题解
C语言字符串匹配函数实现
最新推荐文章于 2024-03-16 17:02:49 发布
642

被折叠的 条评论
为什么被折叠?



