top1编程
← 返回上一页

P4553. 验证子串

时间限制
1000 ms
内存限制
256 MiB
难度
10
知识点
童程童美
知识点
字符串

题目描述

输入两个字符串s1和s2。验证其中一个字符串是否是另一个字符串的子串。

输入格式

两行字符串。字符串中不包含空格,长度在20以内。 第一行是字符串s1。 第二行是字符串s2。

输出格式

若s1是s2的子串,则输出(s1) is substring of (s2); 否则,若s2是s1的子串,输出(s2) is substring of (s1); 否则,输出 No substring。

abc
dncabca
abc is substring of dncabca