#t189. 验证子串
验证子串
Verifying a Substring
Problem Description
Given two strings, determine whether one of them is a substring of the other.
Input Format
Two strings, each on its own line, with length at most and containing no spaces.
Output Format
- If the first string is a substring of the second string , output
s1 is substring of s2(wheres1ands2are the actual strings, without parentheses); - Otherwise, if the second string is a substring of the first string , output
s2 is substring of s1; - Otherwise, output
No substring.
Note: the output strings above (including the lowercase words is substring of and No substring) must be printed exactly as shown — the judge compares them character by character, so do not alter the wording or add/remove spaces.
Sample Input
abc
dddncabca
Sample Output
abc is substring of dddncabca
Sample Explanation
abc appears inside dddncabca, so the first string is a substring of the second, and we output abc is substring of dddncabca.