输入两个字符串,验证其中一个串是否为另一个串的子串。 子串:一个字符串的子串,实际上是指在这个字符串中任意长度的连续字符组成的字符串。 例如:对于字符串 hello, world! ,其子串可以是 hello,也可以是 world ,只要这个连续字符组成的字符串在原字符串中存在,那么就说明 hello 是 hello,world 的子串或者 world 是 hello,world 的子串。
输入两个字符串, 每个字符串占一行,长度大于等于 1 且不超过 200 且不含空格。
若第一个串s1是第二个串s2的子串,则输出 (s1) is substring of (s2) 否则,若第二个串s2是第一个串s1的子串,输出 (s2) is substring of (s1) 否则,输出 No substring。
abc dddncabca
abc is substring of dddncabca
dddncabca nca
nca is substring of dddncabca
提示 此编辑器无法编译 gets()函数,请使用 getline()函数来完成