以下程序的功能是输入一个字符串和一个字符,如果该字符在字符串中,就从该字符首次出现的位置开始输出字符串中的字符。例如,如果输入的字符串为“Hello”,输入的字符为'e',则输出结果为“ello”。请填空。
#include <stdio.h>
char*
match(char *s, char ch) {
while (*s != '\0')
if (*s == ch)
return s
;
else s++;
return NULL
;
}
int main()
{
char ch, str[80], *p = NULL;
scanf("%s", str);
getchar();
ch = getchar();
if ((p = match(str, ch)) != NULL)
printf("%s\n", p);
else
printf("Not Found\n");
return 0;
}