while True: try: s1, s2 = input(), input() # 确保 s1 为较短的字符串(也可等长) if len(s1) > len(s2): s1, s2 = s2, s1 max_len = 0 # 遍历s1中的字符作为子串的起始字符 for i in range(len(s1)): # 可能的公共子串长度为(0, len(s1)-i+1) for L in range(len(s1)-i+1): # 从s1中截取的子串在s2中且截取长度>当前最大长度,则更新最大长度 if s1[i:i+L] in s2 and L > max_len: m...