题解 | #在字符串中找出连续最长的数字串#
在字符串中找出连续最长的数字串
https://www.nowcoder.com/practice/2c81f88ecd5a4cc395b5308a99afbbec
while True: try: max_string = "" all_string = "" string = input() for i in range(len(string)): for j in range(i+1,len(string)+1): if((string[i:j]).isdigit()) and(len(string[i:j])>len(max_string)): max_string = string[i:j] for i in range(len(string)): for j in range(i+1,len(string)+1): if((string[i:j]).isdigit()) and (len(string[i:j])==len(max_string)): all_string = all_string + string[i:j] print(all_string +","+str(len(max_string))) except EOFError: break