编写函数判断B是不是A的子串(假设A的长度大于B的长度,且两个字符串都不超过100个字符)。注意:串中任意个连续的字符组成的子序列称为该串的子串。
主函数中输入两个字符串,并调用上述函数判断,然后在主函数中输出”YES”,或者”NO”。
提示:不能使用库函数。
输入提示信息:“Please input the first str:”
输入格式:"%s"
输入提示信息:“Please input the second str:”
输入格式:"%s"
输出格式:“YES\n” “NO\n”
程序测试用例1:
Please input the first str: Abcdefghijk123
Please input the second str: def
YES
程序测试用例2:
Please input the first str: abc123ef
Please input the second str: df
NO
#include <stdio.h>
#include <string.h>
#define MAXS 80
char *search(char *s, char *t);
int main