tj
2024-10-19 16:25:54
发布于:上海
4阅读
0回复
0点赞
s = input()
substrings = {}
for i in range(len(s)):
for j in range(i + 1, len(s) + 1):
substring = s[i:j]
if substring in substrings:
substrings[substring] += 1
else:
substrings[substring] = 1
for substring, count in sorted(substrings.items()):
if count > 1:
print(substring, count)
这里空空如也
有帮助,赞一个